/* ============================================================
   NamaStege Frontend Styles
   Scandinavian editorial design system
   ============================================================ */

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body.ns-home, body.ns-app-detail {
    font-family: var(--ns-font-body, 'Inter', sans-serif);
    background-color: var(--ns-bg, #F9FAF7);
    color: var(--ns-text, #263746);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ns-accent, #5B8AAE); text-decoration: none; transition: color 0.3s ease, opacity 0.3s ease; }
a:hover { opacity: 0.75; }

/* Skip link */
.ns-skip-link {
    position: absolute; top: -100px; left: 0;
    background: var(--ns-text); color: #fff;
    padding: 8px 16px; z-index: 10000;
    transition: top 0.3s;
}
.ns-skip-link:focus { top: 0; }

/* ============================================================
   Navigation
   ============================================================ */
.ns-nav {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
    padding: 20px 0;
}

.ns-nav.scrolled {
    background-color: var(--ns-surface, #fff);
    box-shadow: 0 1px 0 rgba(38, 55, 70, 0.06);
    padding: 14px 0;
}

[data-nav-style="floating"] .ns-nav-inner {
    max-width: calc(var(--ns-content-width, 1200px) - 40px);
    margin: 0 auto;
    background: var(--ns-surface, #fff);
    border-radius: var(--ns-radius, 12px);
    padding: 12px 24px;
    box-shadow: 0 2px 20px rgba(38, 55, 70, 0.06);
}

[data-nav-style="solid"] .ns-nav:not(.scrolled) {
    background-color: var(--ns-surface, #fff);
    box-shadow: 0 1px 0 rgba(38, 55, 70, 0.05);
}

.ns-nav-inner {
    max-width: var(--ns-content-width, 1200px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.ns-nav-logo { display: flex; align-items: center; }
.ns-nav-logo-img { max-height: 36px; width: auto; }
.ns-nav-wordmark {
    font-family: var(--ns-font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ns-text);
}

.ns-nav.scrolled .ns-nav-wordmark { color: var(--ns-text); }

.ns-nav-links {
    list-style: none;
    display: flex;
    gap: 36px;
    align-items: center;
}

.ns-nav-links a {
    color: var(--ns-text);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    position: relative;
    opacity: 1;
}

.ns-nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1.5px;
    background: var(--ns-accent);
    transition: width 0.3s ease;
}

.ns-nav-links a:hover::after { width: 100%; }

.ns-nav-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.ns-nav-toggle span {
    width: 24px; height: 2px;
    background: var(--ns-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.ns-nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ns-nav-toggle.open span:nth-child(2) { opacity: 0; }
.ns-nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Section system
   ============================================================ */
.ns-section {
    position: relative;
    overflow: hidden;
}

.ns-spacing-small { padding: 60px 24px; }
.ns-spacing-medium { padding: 90px 24px; }
.ns-spacing-large { padding: var(--ns-section-spacing, 120px) 24px; }

.ns-section-inner {
    max-width: var(--ns-content-width, 1200px);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.ns-section-narrow .ns-section-inner { max-width: 760px; }

.ns-section-title {
    font-family: var(--ns-font-heading);
    font-size: clamp(1.75rem, 4vw, var(--ns-heading-base, 3.5rem));
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 32px;
    color: var(--ns-text);
}

.ns-section-text-content {
    font-size: 1.125rem;
    line-height: 1.75;
    max-width: 640px;
    color: var(--ns-text);
}

.ns-section-text-content p { margin-bottom: 1.2em; }

/* ============================================================
   Hero
   ============================================================ */
.ns-section-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.ns-hero-graphic {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.ns-hero-svg {
    width: 100%; height: 100%;
}

.ns-hero-shapes .ns-shape {
    transform-origin: center;
    animation: ns-float 8s ease-in-out infinite;
}

.ns-shape-1 { animation-delay: 0s; animation-duration: 9s; }
.ns-shape-2 { animation-delay: 1.5s; animation-duration: 7s; }
.ns-shape-3 { animation-delay: 3s; animation-duration: 10s; }
.ns-shape-4 { animation-delay: 0.7s; animation-duration: 6s; }
.ns-shape-5 { animation-delay: 2.2s; animation-duration: 8s; }

@keyframes ns-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

.ns-hero-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: ns-draw 6s ease-out forwards infinite;
}

.ns-hero-line-2 { animation-delay: 2s; animation-duration: 8s; }

@keyframes ns-draw {
    0% { stroke-dashoffset: 2000; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -2000; }
}

.ns-hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.ns-hero-title {
    font-family: var(--ns-font-heading);
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: var(--ns-text);
    margin-bottom: 24px;
}

.ns-hero-subtitle {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    line-height: 1.55;
    color: var(--ns-text);
    opacity: 0.8;
    max-width: 560px;
    font-weight: 300;
}

/* ============================================================
   App showcase
   ============================================================ */
.ns-apps-list {
    display: flex;
    flex-direction: column;
    gap: 100px;
}

.ns-app-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.ns-app-showcase-right .ns-app-showcase-visual { order: 2; }

.ns-app-showcase-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ns-app-showcase-logo {
    border-radius: var(--ns-radius, 12px);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(38, 55, 70, 0.08);
    max-width: 280px;
    flex-shrink: 0;
}

.ns-app-showcase-logo img { width: 100%; }

.ns-app-showcase-screens {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ns-app-showcase-screen {
    border-radius: var(--ns-radius, 12px);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(38, 55, 70, 0.06);
    max-width: 180px;
}

.ns-app-showcase-info {
    padding: 0 20px;
}

.ns-app-showcase-name {
    font-family: var(--ns-font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--ns-text);
    margin-bottom: 12px;
}

.ns-app-showcase-subtitle {
    font-size: 1.25rem;
    color: var(--ns-app-accent, var(--ns-accent));
    margin-bottom: 16px;
    font-weight: 500;
}

.ns-app-showcase-desc {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--ns-text);
    opacity: 0.85;
    margin-bottom: 24px;
}

.ns-app-showcase-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.ns-app-showcase-area {
    font-size: 0.875rem;
    color: var(--ns-text);
    opacity: 0.6;
    letter-spacing: 0.02em;
}

.ns-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ns-status-live { background: #D4EDDA; color: #155724; }
.ns-status-development { background: #FFF3CD; color: #856404; }
.ns-status-coming { background: #E6E3F4; color: #4B3F8A; }
.ns-status-retired { background: #F8D7DA; color: #721C24; }

.ns-app-showcase-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ns-app-showcase-soon {
    font-size: 0.875rem;
    color: var(--ns-text);
    opacity: 0.5;
    font-style: italic;
}

/* ============================================================
   Buttons
   ============================================================ */
.ns-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--ns-font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: var(--ns-button-radius, 8px);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.ns-btn-primary {
    background: var(--ns-accent, #5B8AAE);
    color: #fff;
}

.ns-btn-primary:hover {
    background: var(--ns-text, #263746);
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(38, 55, 70, 0.15);
}

.ns-btn-secondary {
    background: transparent;
    color: var(--ns-text);
    border: 1.5px solid rgba(38, 55, 70, 0.15);
}

.ns-btn-secondary:hover {
    border-color: var(--ns-accent);
    color: var(--ns-accent);
    opacity: 1;
    transform: translateY(-1px);
}

.ns-btn-lg { padding: 16px 36px; font-size: 1rem; }
.ns-btn-sm { padding: 8px 20px; font-size: 0.875rem; }

.ns-btn-soon {
    background: var(--ns-soft-lavender, #E6E3F4);
    color: var(--ns-text);
    opacity: 0.6;
    cursor: default;
}

/* ============================================================
   Contact
   ============================================================ */
.ns-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    margin-top: 40px;
}

.ns-contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 28px;
    text-decoration: none;
}

.ns-contact-item:hover { opacity: 0.7; }

.ns-contact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ns-text);
    opacity: 0.5;
    font-weight: 600;
}

.ns-contact-value {
    font-size: 1.125rem;
    color: var(--ns-text);
}

.ns-contact-form-wrap { }

.ns-contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--ns-surface, #fff);
    padding: 36px;
    border-radius: var(--ns-radius, 12px);
    box-shadow: 0 4px 30px rgba(38, 55, 70, 0.05);
}

.ns-form-field { display: flex; flex-direction: column; gap: 8px; }

.ns-form-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ns-text);
}

.ns-form-field input,
.ns-form-field textarea {
    padding: 12px 16px;
    border: 1.5px solid rgba(38, 55, 70, 0.1);
    border-radius: var(--ns-button-radius, 8px);
    font-family: var(--ns-font-body);
    font-size: 1rem;
    color: var(--ns-text);
    background: var(--ns-warm-off-white, #F9FAF7);
    transition: border-color 0.3s, background 0.3s;
}

.ns-form-field input:focus,
.ns-form-field textarea:focus {
    outline: none;
    border-color: var(--ns-accent);
    background: #fff;
}

.ns-form-status {
    font-size: 0.9375rem;
    padding: 12px;
    border-radius: var(--ns-button-radius, 8px);
    display: none;
}

.ns-form-status.success { display: block; background: #D4EDDA; color: #155724; }
.ns-form-status.error { display: block; background: #F8D7DA; color: #721C24; }

.ns-form-privacy {
    font-size: 0.8125rem;
    color: var(--ns-text);
    opacity: 0.5;
    margin-top: 16px;
}

/* ============================================================
   App detail page
   ============================================================ */
.ns-app-hero {
    padding-top: 120px;
    padding-bottom: 60px;
    padding-left: 24px;
    padding-right: 24px;
}

.ns-app-hero-inner {
    max-width: var(--ns-content-width, 1200px);
    margin: 0 auto;
}

.ns-app-hero-text { max-width: 700px; }

.ns-app-hero-logo {
    width: 100px; height: 100px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 8px 40px rgba(38, 55, 70, 0.1);
}

.ns-app-hero-logo img { width: 100%; height: 100%; object-fit: cover; }

.ns-app-title {
    font-family: var(--ns-font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--ns-text);
    margin-bottom: 16px;
}

.ns-app-subtitle {
    font-size: 1.375rem;
    color: var(--ns-app-accent, var(--ns-accent));
    margin-bottom: 20px;
    font-weight: 500;
}

.ns-app-shortdesc {
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--ns-text);
    opacity: 0.8;
    margin-bottom: 32px;
}

.ns-app-meta {
    display: flex;
    gap: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.ns-app-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ns-app-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ns-text);
    opacity: 0.5;
    font-weight: 600;
}

.ns-app-meta-value {
    font-size: 1rem;
    color: var(--ns-text);
    font-weight: 500;
}

.ns-app-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.ns-app-gallery {
    padding: 60px 24px;
    background: var(--ns-bg);
}

.ns-app-gallery-inner {
    max-width: var(--ns-content-width, 1200px);
    margin: 0 auto;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.ns-app-gallery-item {
    border-radius: var(--ns-radius, 12px);
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(38, 55, 70, 0.08);
}

.ns-app-content {
    padding: 80px 24px;
}

.ns-app-content-inner {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
}

.ns-app-content-inner h2 {
    font-family: var(--ns-font-heading);
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.8em;
    letter-spacing: -0.02em;
}

.ns-app-content-inner h3 {
    font-family: var(--ns-font-heading);
    font-size: 1.375rem;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
}

.ns-app-content-inner p { margin-bottom: 1.2em; }

.ns-app-back {
    padding: 40px 24px 80px;
    text-align: center;
}

.ns-back-link {
    color: var(--ns-text);
    opacity: 0.6;
    font-size: 0.9375rem;
}

.ns-back-link:hover { opacity: 1; color: var(--ns-accent); }

/* ============================================================
   Footer
   ============================================================ */
.ns-footer {
    background: var(--ns-text, #263746);
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 24px 32px;
}

.ns-footer-inner {
    max-width: var(--ns-content-width, 1200px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.ns-footer-brand { display: flex; flex-direction: column; gap: 4px; }
.ns-footer-name { font-size: 1.125rem; font-weight: 600; color: #fff; }
.ns-footer-tagline { font-size: 0.875rem; opacity: 0.6; }

.ns-footer-contact { display: flex; flex-direction: column; gap: 8px; }
.ns-footer-contact a { color: rgba(255, 255, 255, 0.7); font-size: 0.9375rem; }
.ns-footer-contact a:hover { color: #fff; opacity: 1; }

.ns-footer-social { display: flex; flex-direction: column; gap: 8px; }
.ns-footer-social a { color: rgba(255, 255, 255, 0.7); font-size: 0.9375rem; }
.ns-footer-social a:hover { color: #fff; opacity: 1; }

.ns-footer-bottom {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    margin-top: 20px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.8125rem;
    opacity: 0.6;
}

.ns-footer-cvr { letter-spacing: 0.02em; }
.ns-footer-bottom a { color: rgba(255, 255, 255, 0.7); }
.ns-footer-bottom a:hover { color: #fff; }

/* ============================================================
   Portfolio shortcode
   ============================================================ */
.ns-portfolio-shortcode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.ns-portfolio-item {
    background: var(--ns-surface, #fff);
    border-radius: var(--ns-radius, 12px);
    padding: 24px;
    box-shadow: 0 2px 20px rgba(38, 55, 70, 0.05);
}

/* ============================================================
   CTA section
   ============================================================ */
.ns-cta-inner { text-align: center; }
.ns-cta-title {
    font-family: var(--ns-font-heading);
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    color: var(--ns-text);
}
.ns-cta-text { font-size: 1.125rem; margin-bottom: 32px; color: var(--ns-text); opacity: 0.8; }

/* ============================================================
   Quote section
   ============================================================ */
.ns-quote {
    font-family: var(--ns-font-heading);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: var(--ns-text);
    border: none;
    padding: 0;
}

.ns-quote cite {
    display: block;
    margin-top: 20px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--ns-text);
    opacity: 0.6;
    font-style: normal;
}

/* ============================================================
   Animations — scroll reveal
   ============================================================ */
.ns-anim-on .ns-reveal {
    opacity: 0;
    transition: opacity var(--ns-anim-duration, 0.8s) ease, transform var(--ns-anim-duration, 0.8s) ease;
}

.ns-anim-on .ns-reveal[data-animation="fade"] { transform: translateY(20px); }
.ns-anim-on .ns-reveal[data-animation="slide-left"] { transform: translateX(-40px); }
.ns-anim-on .ns-reveal[data-animation="slide-right"] { transform: translateX(40px); }
.ns-anim-on .ns-reveal[data-animation="reveal"] { transform: translateY(40px) scale(0.98); }

.ns-anim-on .ns-reveal.ns-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.ns-anim-off .ns-reveal { opacity: 1; }

/* Stagger children */
.ns-anim-on .ns-app-showcase .ns-app-showcase-logo { opacity: 0; transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s; transform: scale(0.9); }
.ns-anim-on .ns-app-showcase.ns-visible .ns-app-showcase-logo { opacity: 1; transform: scale(1); }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ns-reveal { opacity: 1 !important; transform: none !important; }
    .ns-hero-shapes .ns-shape { animation: none !important; }
    .ns-hero-line { animation: none !important; stroke-dashoffset: 0 !important; }
}

/* ============================================================
   Responsive — tablet
   ============================================================ */
@media (max-width: 968px) {
    .ns-app-showcase {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .ns-app-showcase-right .ns-app-showcase-visual { order: 0; }

    .ns-app-showcase-info { padding: 0; }

    .ns-contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .ns-footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ============================================================
   Responsive — mobile
   ============================================================ */
@media (max-width: 768px) {
    .ns-nav-links {
        position: fixed;
        top: 0; right: 0;
        width: 280px;
        height: 100vh;
        background: var(--ns-surface, #fff);
        flex-direction: column;
        gap: 0;
        padding: 80px 24px 24px;
        transform: translateX(100%);
        transition: transform 0.4s ease;
        box-shadow: -4px 0 40px rgba(0, 0, 0, 0.08);
    }

    .ns-nav-links.open { transform: translateX(0); }

    .ns-nav-links li {
        width: 100%;
        border-bottom: 1px solid rgba(38, 55, 70, 0.05);
    }

    .ns-nav-links a {
        display: block;
        padding: 16px 0;
        font-size: 1rem;
    }

    .ns-nav-links a::after { display: none; }

    .ns-nav-toggle { display: flex; z-index: 1001; }

    .ns-spacing-large { padding: 80px 20px; }
    .ns-spacing-medium { padding: 60px 20px; }

    .ns-apps-list { gap: 60px; }

    .ns-app-showcase-logo { max-width: 160px; }

    .ns-app-showcase-screens { display: none; }

    .ns-contact-form { padding: 24px; }

    .ns-app-meta { gap: 20px; }

    .ns-app-hero { padding-top: 100px; }

    .ns-hero-graphic { opacity: 0.5; }
}

@media (max-width: 480px) {
    .ns-app-showcase-name { font-size: 1.75rem; }
    .ns-hero-title { font-size: 2rem; }
    .ns-app-buttons { flex-direction: column; align-items: stretch; }
    .ns-app-buttons .ns-btn { text-align: center; }
}
