/* ============================================================
   NYNE LABS — site styles
   Warm editorial "indie software studio" theme with its own
   identity: a calm editorial header, a split hero, and a
   numbered product index. Deep forest greens on warm paper,
   with a humanist sans + high-contrast serif for accent words.
   ============================================================ */

:root {
    --white: #ffffff;
    --bg: #f7f6f1;
    --surface: #ffffff;
    --text: #1c2620;
    --text-secondary: #5f6b64;
    --text-muted: #6d756f;
    --border: rgba(28, 38, 32, 0.08);
    --border-strong: rgba(28, 38, 32, 0.14);
    --accent: #245c40;
    --accent-strong: #1c4b33;
    --accent-rgb: 36, 92, 64;

    --sans: "Inter", -apple-system, system-ui, sans-serif;
    --serif: "Fraunces", Georgia, serif;

    --max-w: 1080px;
    --gutter: clamp(20px, 4vw, 48px);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 100px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- reset ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

/* ---------- base ---------- */

::selection {
    background: var(--accent);
    color: var(--white);
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

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

.wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

section {
    position: relative;
    z-index: 2;
}

em.accent {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    color: var(--accent);
}

/* ---------- grain + subtle backdrop ---------- */

.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.45;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)" opacity="0.04"/%3E%3C/svg%3E');
    background-repeat: repeat;
    background-size: 256px 256px;
}

.backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 560px;
    background:
        radial-gradient(ellipse 70% 60% at 20% 10%, rgba(36, 92, 64, 0.05), transparent),
        radial-gradient(ellipse 55% 50% at 80% 25%, rgba(129, 158, 90, 0.05), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ---------- editorial header ---------- */

.header {
    position: relative;
    z-index: 9000;
    border-bottom: 1px solid var(--border);
    background: rgba(247, 246, 241, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    font-size: 15px;
    color: var(--text);
}

.brand img {
    height: 26px;
    width: auto;
    border-radius: 7px;
}

.brand:hover {
    background: none;
    color: var(--accent);
}

.header-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.header-links a:hover {
    color: var(--accent);
    background: none;
}

.header-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.header-burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

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

.header-mobile {
    display: none;
    width: 100%;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.header-mobile.open { display: block; }

.header-mobile a {
    display: block;
    padding: 14px var(--gutter);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.header-mobile a:hover { color: var(--accent); background: none; }

/* ---------- hero (split) ---------- */

.hero {
    padding: clamp(64px, 10vw, 120px) 0 24px;
    position: relative;
}

.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(32px, 6vw, 72px);
    align-items: center;
}

.hero-copy h1 {
    font-family: var(--sans);
    font-size: clamp(40px, 5.5vw, 62px);
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin: 0 0 20px;
    text-transform: none;
}

.hero-copy p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 0 28px;
    line-height: 1.7;
}

.hero-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.hero-platforms span {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    background: rgba(var(--accent-rgb), 0.06);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
}

/* hero icon grid */
.hero-apps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    position: relative;
    max-width: 360px;
}

.hero-app {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.hero-app:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.14);
}

.hero-app img {
    width: 56px;
    height: 56px;
    border-radius: 26%;
}

.hero-app .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* ---------- section scaffolding ---------- */

.eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin: 0 0 16px;
}

.section {
    padding: clamp(56px, 8vw, 96px) 0;
}

.section-header h2 {
    font-family: var(--sans);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 12px;
    text-transform: none;
}

.section-header p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 560px;
    line-height: 1.7;
}

/* ---------- numbered product index ---------- */

.index {
    border-top: 1px solid var(--border-strong);
}

.index-row {
    display: grid;
    grid-template-columns: 80px 120px 1fr auto;
    gap: clamp(20px, 4vw, 48px);
    align-items: center;
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.25s ease;
}

.index-row:hover { background: rgba(var(--accent-rgb), 0.04); }

.index-num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    color: var(--text-muted);
}

.index-icon {
    width: 64px;
    height: 64px;
}

.index-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 22%;
}

.index-name {
    font-family: var(--sans);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0 0 6px;
    text-transform: none;
    color: var(--text);
}

.index-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    max-width: 420px;
}

.index-link {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.index-link:hover {
    color: var(--accent-strong);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
}

/* ---------- CTA ---------- */

.cta { position: relative; }

.cta-card {
    background: var(--text);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: clamp(40px, 6vw, 72px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card:before {
    content: "";
    position: absolute;
    top: -60%; left: -20%;
    width: 140%; height: 220%;
    background: radial-gradient(ellipse at 30% 40%, rgba(36, 92, 64, 0.55) 0%, transparent 55%), radial-gradient(ellipse at 70% 60%, rgba(129, 158, 90, 0.25) 0%, transparent 55%);
    pointer-events: none;
}

.cta-card:after {
    content: "";
    position: absolute; inset: 0;
    background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)"/%3E%3C/svg%3E');
    opacity: 0.05;
    pointer-events: none;
}

.cta-card h2 {
    font-family: var(--sans);
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 14px;
    position: relative;
    color: var(--white);
    text-transform: none;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 17px;
    margin: 0 0 28px;
    position: relative;
}

.cta-email {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    position: relative;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.cta-email:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: var(--accent);
    background: none;
}

/* ---------- footer ---------- */

.footer {
    padding: 48px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.footer-email {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.footer-email:hover { color: var(--accent); background: none; }

/* ---------- reveal ---------- */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- back to top ---------- */

.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 8000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
    pointer-events: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
}

.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--white); transform: translateY(-2px); color: var(--accent); }

/* ---------- skip link ---------- */

.skip-to-content {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top 0.2s;
}

.skip-to-content:focus { top: 16px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; gap: 40px; }
    .hero-copy p { max-width: 100%; }
    .index-row { grid-template-columns: 60px 90px 1fr; grid-template-areas: "num icon name" "num icon desc"; row-gap: 8px; }
    .index-num { grid-area: num; }
    .index-icon { grid-area: icon; }
    .index-name { grid-area: name; }
    .index-desc { grid-area: desc; }
    .index-link { grid-column: 2 / -1; }
}

@media (max-width: 680px) {
    .header-links { display: none; }
    .header-burger { display: flex; }

    .hero-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .index-row { grid-template-columns: 40px 1fr; grid-template-areas: "num name" "icon ." "desc desc" "link link"; row-gap: 4px; }
    .index-icon { grid-area: icon; width: 56px; height: 56px; }
    .index-name { grid-area: name; }
    .index-desc { grid-area: desc; }
    .index-link { grid-area: link; margin-top: 6px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
    .hero-app, .index-row:hover { transition: none !important; }
}
