/* ======================================================================
   SHEHAB GINEM — PORTFOLIO
   Editorial-Technical Hybrid · v1.0
   ====================================================================== */

/* -------- Design Tokens -------- */
:root {
    /* Color — warm paper aesthetic with vermillion accent */
    --paper:        #F4EFE6;
    --paper-deep:   #E8E1D4;
    --paper-line:   #D4CCBC;
    --ink:          #1A1A1A;
    --ink-soft:     #3A3633;
    --ink-mute:     #8A8580;
    --ink-faint:    #B8B0A6;
    --accent:       #C8462C;          /* burnt vermillion */
    --accent-deep:  #A83820;
    --accent-soft:  rgba(200, 70, 44, 0.08);

    /* Typography */
    --font-display: 'Fraunces', 'Times New Roman', serif;
    --font-body:    'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, monospace;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;
    --space-10: 8rem;

    /* Layout */
    --container: 1440px;
    --gutter: 2rem;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

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

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
ul { list-style: none; }

::selection { background: var(--ink); color: var(--paper); }

/* -------- Grain texture overlay (paper feel) -------- */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.35;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* -------- Top status ticker -------- */
.ticker {
    position: relative;
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
    border-bottom: 1px solid var(--ink);
    z-index: 100;
}
.ticker__track {
    display: flex;
    gap: 2.5rem;
    padding: 0.6rem 0;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    animation: ticker-scroll 50s linear infinite;
    will-change: transform;
}
.ticker__track span { flex-shrink: 0; }
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* -------- Navigation -------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 90;
    transition: all 0.3s var(--ease-out);
    background: var(--paper);
    border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
    border-bottom-color: var(--paper-line);
    background: rgba(244, 239, 230, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.nav__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.25rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.nav__monogram {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.monogram__mark {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    font-style: italic;
    font-variation-settings: "opsz" 14, "SOFT" 100;
    line-height: 1;
    letter-spacing: -0.02em;
}
.monogram__divider {
    width: 1px;
    height: 16px;
    background: var(--ink-mute);
}
.monogram__sub { color: var(--ink-soft); }

.nav__links {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.nav__links a {
    position: relative;
    padding: 0.5rem 0;
    color: var(--ink-soft);
    transition: color 0.3s var(--ease-out);
}
.nav__links a::after {
    content: '';
    position: absolute;
    left: 0; right: 100%;
    bottom: 0.25rem;
    height: 1px;
    background: var(--ink);
    transition: right 0.3s var(--ease-out);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { right: 0; }
.nav__links .nav__cta {
    padding: 0.5rem 1rem;
    border: 1px solid var(--ink);
    color: var(--ink);
    transition: all 0.25s var(--ease-out);
}
.nav__links .nav__cta::after { display: none; }
.nav__links .nav__cta:hover {
    background: var(--ink);
    color: var(--paper);
}

.nav__menu-btn {
    display: none;
    width: 28px;
    height: 28px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}
.nav__menu-btn span {
    display: block;
    height: 1px;
    background: var(--ink);
    transition: transform 0.3s var(--ease-out);
}
.nav__menu-btn.is-active span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__menu-btn.is-active span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* -------- Mobile menu -------- */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: var(--paper);
    z-index: 80;
    padding: 6rem 2rem 3rem;
    transform: translateY(-100%);
    transition: transform 0.5s var(--ease-out);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.mobile-menu__nav a {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--paper-line);
    padding-bottom: 1.5rem;
}
.mobile-menu__meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

/* ======================================================================
   SECTIONS — General
   ====================================================================== */
main { display: block; }

section {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section-head {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 5rem 0 3rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.section-num {
    color: var(--accent);
    font-weight: 500;
}
.section-title { color: var(--ink); }
.section-rule {
    height: 1px;
    background: var(--paper-line);
    width: 100%;
}
.section-meta { color: var(--ink-mute); }

/* ======================================================================
   HERO
   ====================================================================== */
.hero {
    padding-top: 4rem;
    padding-bottom: 0;
    border-bottom: 1px solid var(--paper-line);
}
.hero__grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4rem;
    align-items: start;
    padding-bottom: 5rem;
}
.hero__meta {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 0.5rem;
    border-right: 1px solid var(--paper-line);
    padding-right: 2rem;
}
.meta-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.meta-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.meta-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink);
    line-height: 1.4;
}

.hero__main {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.hero__overline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.hero__title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 9vw, 9rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    font-variation-settings: "opsz" 144, "SOFT" 50;
    color: var(--ink);
}
.hero__title .line {
    display: block;
    overflow: hidden;
}
.hero__title em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
    font-variation-settings: "opsz" 144, "SOFT" 100;
}

.hero__footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: end;
    padding-top: 2rem;
    border-top: 1px solid var(--paper-line);
}

.hero__lede {
    max-width: 38rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--ink-soft);
    font-weight: 300;
}

.hero__actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.25s var(--ease-out);
    cursor: pointer;
}
.btn--primary {
    background: var(--ink);
    color: var(--paper);
}
.btn--primary:hover {
    background: var(--accent);
}
.btn--primary svg { transition: transform 0.3s var(--ease-out); }
.btn--primary:hover svg { transform: translate(2px, -2px); }

.btn--ghost {
    border: 1px solid var(--ink);
    color: var(--ink);
}
.btn--ghost:hover {
    background: var(--ink);
    color: var(--paper);
}

.hero__rule {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--ink);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.rule-label { color: var(--accent); font-weight: 500; }
.rule-text { color: var(--ink-soft); }
.rule-arrow {
    display: inline-block;
    animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ======================================================================
   ABOUT / MANIFESTO
   ====================================================================== */
.about {
    padding-bottom: 6rem;
    border-bottom: 1px solid var(--paper-line);
}
.about__grid {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about__intro {
    position: sticky;
    top: 6rem;
}
.about__quote {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    color: var(--ink);
}
.about__quote em {
    font-style: italic;
    color: var(--accent);
    font-variation-settings: "opsz" 144, "SOFT" 80;
}

.about__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.about__para {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink-soft);
    font-weight: 300;
}
.about__para strong {
    font-weight: 500;
    color: var(--ink);
}

.about__sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-left: 1px solid var(--paper-line);
    padding-left: 2rem;
}
.sidebar-block { display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}
.sidebar-block p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ink-soft);
}
.muted { color: var(--ink-mute); font-family: var(--font-mono); font-size: 0.8rem; }

/* ======================================================================
   WORK / PROJECTS
   ====================================================================== */
.work {
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--paper-line);
}

.project {
    display: grid;
    grid-template-columns: 60px 1.1fr 1fr;
    gap: 3rem;
    padding: 5rem 0;
    border-bottom: 1px solid var(--paper-line);
    align-items: start;
}
.project:last-child { border-bottom: 0; }
.project--reverse {
    grid-template-columns: 60px 1fr 1.1fr;
}
.project--reverse .project__visual { order: 3; }
.project--reverse .project__info { order: 2; }

.project__num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    text-transform: uppercase;
    padding-top: 0.4rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    align-self: start;
    height: 100%;
}

.project__visual {
    aspect-ratio: 4 / 3;
    background: var(--paper-deep);
    overflow: hidden;
    position: relative;
    transition: transform 0.6s var(--ease-out);
}
.project__visual-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: transform 0.6s var(--ease-out);
}
.project:hover .project__visual-inner {
    transform: scale(1.02);
}

/* ---- Project Visual 1: Valabasas Stack Grid ---- */
.project-vis-1 {
    background: linear-gradient(135deg, var(--ink) 0%, #2a2624 100%);
}
.vis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 1px;
    width: 100%;
    height: 100%;
    background: rgba(244, 239, 230, 0.1);
}
.vis-cell {
    background: var(--ink);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.vis-cell--lg { grid-column: 1 / -1; padding: 1.5rem; }
.vis-cell--logo {
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
}
.vis-label { color: var(--accent); }
.vis-text { color: var(--paper); font-size: 0.85rem; }
.vis-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--paper);
    line-height: 1;
}
.vis-cap { color: var(--ink-mute); }
.vlbs-mark {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--paper);
    font-variation-settings: "opsz" 144, "SOFT" 0;
}

/* ---- Project Visual 2: AI Pipeline ---- */
.project-vis-2 {
    background: var(--paper);
    border: 1px solid var(--paper-line);
}
.ai-pipeline {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    width: 100%;
    position: relative;
}
.pipeline-stage {
    background: var(--paper-deep);
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid var(--paper-line);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.pipeline-stage--accent {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.stage-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    text-transform: uppercase;
}
.pipeline-stage--accent .stage-label { color: var(--accent); }
.stage-content {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink);
    letter-spacing: 0.05em;
}
.pipeline-stage--accent .stage-content { color: var(--paper); }
.pipeline-arrow {
    font-family: var(--font-mono);
    color: var(--ink-mute);
    font-size: 1rem;
}
.pipeline-meta {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--ink-mute);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-top: 1rem;
    border-top: 1px solid var(--paper-line);
}

/* ---- Project Visual 3: RFID ---- */
.project-vis-3 {
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
}
.rfid-vis {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.rfid-tags {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.rfid-tag {
    color: var(--accent);
    font-size: 1.5rem;
    animation: rfid-blink 3s ease-in-out infinite;
}
.rfid-tag:nth-child(2) { animation-delay: 0.3s; }
.rfid-tag:nth-child(3) { animation-delay: 0.6s; }
.rfid-tag:nth-child(4) { animation-delay: 0.9s; }
.rfid-tag:nth-child(5) { animation-delay: 1.2s; }
.rfid-tag:nth-child(6) { animation-delay: 1.5s; }
@keyframes rfid-blink {
    0%, 90%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}
.rfid-pulse {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: rfid-scan 2.5s linear infinite;
}
@keyframes rfid-scan {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}
.rfid-readout {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.readout-line {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-top: 1px dashed rgba(244, 239, 230, 0.15);
}
.readout-tag { color: var(--paper); }
.readout-status { color: var(--ink-mute); letter-spacing: 0.1em; }
.readout-status--live { color: var(--accent); animation: pulse 1.5s ease-in-out infinite; }

/* ---- Project Visual 4: ERP Spec ---- */
.project-vis-4 {
    background: var(--paper);
    border: 1px solid var(--ink);
    align-items: stretch !important;
    padding: 0 !important;
}
.erp-vis {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.erp-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.4fr;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--paper-line);
    align-items: center;
    transition: background 0.2s;
}
.erp-row:hover { background: var(--paper-deep); }
.erp-row:last-child { border-bottom: 0; }
.erp-row--header {
    background: var(--ink);
    color: var(--paper);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.erp-row--header:hover { background: var(--ink); }
.erp-status { color: var(--ink-soft); font-size: 0.7rem; letter-spacing: 0.05em; }
.erp-row .erp-status::first-letter { color: #4a9d4a; font-size: 1rem; }
.erp-ai { color: var(--accent); font-weight: 500; }

/* ---- Project Visual 5: Computer Vision Hand ---- */
.project-vis-5 {
    background: var(--paper-deep);
    flex-direction: column;
}
.cv-vis {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.cv-hand {
    width: 60%;
    max-width: 240px;
    flex: 1;
}
.cv-node {
    fill: var(--accent);
}
.cv-node--main {
    fill: var(--ink);
    animation: cv-pulse 2s ease-in-out infinite;
}
@keyframes cv-pulse {
    0%, 100% { transform: scale(1); transform-origin: 100px 120px; }
    50% { transform: scale(1.3); transform-origin: 100px 120px; }
}
.cv-link {
    stroke: var(--ink);
    stroke-width: 1;
    opacity: 0.6;
}
.cv-readout {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-soft);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---- Project Visual 6: Memphis Marketplace ---- */
.project-vis-6 {
    background: var(--accent);
    color: var(--paper);
    flex-direction: column;
    justify-content: space-between !important;
    align-items: stretch !important;
}
.mkt-vis {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.mkt-clock {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.mkt-clock-num {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--paper);
}
.mkt-promise {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: -0.03em;
    font-weight: 300;
}
.mkt-promise-line { display: block; }
.mkt-promise-line--accent {
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 100;
}
.mkt-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    padding-top: 1rem;
    border-top: 1px solid rgba(244, 239, 230, 0.3);
}

/* ---- Project Visual 7: Sufyan Privacy-First Chat ---- */
.project-vis-7 {
    background: var(--paper-deep);
    border: 1px solid var(--ink);
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0 !important;
}
.sufyan-vis {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    font-family: var(--font-mono);
}
.sufyan-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--paper-line);
    background: var(--paper);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    color: var(--ink-soft);
    text-transform: uppercase;
}
.sufyan-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}
.sufyan-chat {
    flex: 1;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    justify-content: center;
}
.sufyan-bubble {
    padding: 0.85rem 1rem 0.95rem;
    max-width: 78%;
    transition: transform 0.4s var(--ease-out);
}
.sufyan-bubble-label {
    display: block;
    font-size: 0.55rem;
    letter-spacing: 0.18em;
    color: var(--ink-mute);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}
.sufyan-bubble--user {
    background: var(--paper);
    border: 1px solid var(--paper-line);
    align-self: flex-start;
}
.sufyan-bubble--ai {
    background: var(--ink);
    color: var(--paper);
    align-self: flex-end;
    border: 1px solid var(--ink);
}
.sufyan-bubble--ai .sufyan-bubble-label {
    color: var(--accent);
}
.sufyan-bubble p {
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 400;
    letter-spacing: -0.01em;
    font-variation-settings: "opsz" 144, "SOFT" 50;
}
.project:hover .sufyan-bubble--user { transform: translateX(-2px); }
.project:hover .sufyan-bubble--ai { transform: translateX(2px); }
.sufyan-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 1.25rem;
    border-top: 1px solid var(--paper-line);
    background: var(--paper);
    font-size: 0.55rem;
    letter-spacing: 0.14em;
    color: var(--ink-mute);
    text-transform: uppercase;
}

/* ---- Project info column ---- */
.project__info { display: flex; flex-direction: column; gap: 1.5rem; padding-top: 0.5rem; }
.project__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--paper-line);
    padding-bottom: 1rem;
}
.project__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    color: var(--ink);
}
.project__year {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    flex-shrink: 0;
}
.project__desc {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ink-soft);
    font-weight: 300;
}
.project__specs {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.spec-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--paper-line);
    align-items: start;
}
.spec-row dt {
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.65rem;
    padding-top: 0.15rem;
}
.spec-row dd { color: var(--ink); line-height: 1.5; }
.project__link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    padding-top: 0.5rem;
    align-self: flex-start;
    transition: gap 0.3s var(--ease-out);
    display: inline-flex;
    gap: 0.5rem;
}
.project__link:hover { gap: 0.85rem; color: var(--accent-deep); }

/* ---- Case study expandable ---- */
.case-study {
    margin-top: 0.5rem;
    border-top: 1px solid var(--paper-line);
}
.case-study summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    transition: color 0.2s;
    user-select: none;
}
.case-study summary::-webkit-details-marker { display: none; }
.case-study summary:hover { color: var(--accent-deep); }
.case-study__icon {
    width: 24px;
    height: 24px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-out);
}
.case-study__icon::before,
.case-study__icon::after {
    content: '';
    position: absolute;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.case-study__icon::before {
    width: 10px;
    height: 1px;
}
.case-study__icon::after {
    width: 1px;
    height: 10px;
    transition: transform 0.3s var(--ease-out);
    transform: translate(-50%, -50%) rotate(0deg);
}
.case-study[open] .case-study__icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}
.case-study[open] .case-study__icon {
    transform: rotate(180deg);
}

.case-study__body {
    padding: 0.5rem 0 1.5rem;
    border-top: 1px dashed var(--paper-line);
    animation: case-fade 0.5s var(--ease-out);
}
@keyframes case-fade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.case-study__body h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--paper-line);
}
.case-study__body h4:first-child { margin-top: 1rem; }
.case-study__body p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--ink-soft);
    font-weight: 300;
    margin-bottom: 0.75rem;
}

/* ======================================================================
   ENGINEERING APPROACH
   ====================================================================== */
.approach {
    padding-bottom: 6rem;
    border-bottom: 1px solid var(--paper-line);
}
.approach__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--paper-line);
    border: 1px solid var(--paper-line);
}
.principle {
    background: var(--paper);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: background 0.3s;
    position: relative;
    min-height: 280px;
}
.principle:hover { background: var(--paper-deep); }
.principle__num {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 1rem;
}
.principle__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--ink);
    font-variation-settings: "opsz" 144, "SOFT" 30;
    margin-bottom: 0.25rem;
}
.principle__body {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--ink-soft);
    font-weight: 300;
}

/* ======================================================================
   CAPABILITIES
   ====================================================================== */
.capabilities {
    padding-bottom: 6rem;
    border-bottom: 1px solid var(--paper-line);
}
.capabilities__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    padding-top: 1rem;
}
.cap-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ink);
}
.cap-heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    font-variation-settings: "opsz" 144, "SOFT" 50;
    color: var(--ink);
}
.cap-list { display: flex; flex-direction: column; gap: 0.75rem; }
.cap-list li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--paper-line);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-soft);
    line-height: 1.4;
    transition: color 0.2s;
}
.cap-list li:hover { color: var(--ink); }
.cap-list li span {
    color: var(--accent);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding-top: 0.15rem;
}

/* ======================================================================
   CURRENTLY / NOW
   ====================================================================== */
.currently {
    padding-bottom: 6rem;
    border-bottom: 1px solid var(--paper-line);
}
.currently__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--paper-line);
    border: 1px solid var(--paper-line);
}
.now-card {
    background: var(--paper);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: background 0.3s;
}
.now-card:hover { background: var(--paper-deep); }
.now-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.now-card h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--ink);
    font-variation-settings: "opsz" 144, "SOFT" 30;
}
.now-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--ink-soft);
    font-weight: 300;
}

/* ======================================================================
   CONTACT
   ====================================================================== */
.contact {
    padding-bottom: 6rem;
}
.contact__main {
    padding: 4rem 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 64rem;
}
.contact__overline {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--accent);
}
.contact__title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.5rem, 7vw, 6rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
    color: var(--ink);
    font-variation-settings: "opsz" 144, "SOFT" 30;
}
.contact__title em {
    font-style: italic;
    color: var(--accent);
    font-variation-settings: "opsz" 144, "SOFT" 100;
}
.contact__lede {
    max-width: 38rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--ink-soft);
    font-weight: 300;
}

.contact__email {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.75rem 2rem;
    border: 1px solid var(--ink);
    margin-top: 1rem;
    transition: all 0.3s var(--ease-out);
    background: var(--paper);
}
.contact__email:hover {
    background: var(--ink);
    color: var(--paper);
}
.contact__email-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--accent);
}
.contact__email-addr {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    font-variation-settings: "opsz" 144, "SOFT" 30;
}
.contact__email-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s var(--ease-out);
}
.contact__email:hover .contact__email-arrow { transform: translate(6px, -6px); }

.contact__channels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-top: 2rem;
    border-top: 1px solid var(--paper-line);
    padding-top: 2rem;
}
.channel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 1.5rem;
    border-right: 1px solid var(--paper-line);
}
.channel:last-child { border-right: 0; }
.channel-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.channel a, .channel span:not(.channel-label) {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink);
    transition: color 0.2s;
}
.channel a:hover { color: var(--accent); }

/* ======================================================================
   FOOTER
   ====================================================================== */
.footer {
    max-width: var(--container);
    margin: 0 auto;
    padding: 3rem var(--gutter);
    border-top: 1px solid var(--ink);
}
.footer__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 6rem;
}
.footer__logo {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}
.footer__mark {
    font-family: var(--font-display);
    font-size: 4rem;
    font-style: italic;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.04em;
    font-variation-settings: "opsz" 144, "SOFT" 100;
    line-height: 1;
}
.footer__name {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
}
.footer__year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--ink-mute);
}
.footer__bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--paper-line);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

/* ======================================================================
   REVEAL ANIMATIONS
   ====================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero load animation */
.hero__overline { animation: rise 0.8s var(--ease-out) 0.1s both; }
.hero__title .line--1 { animation: rise 1s var(--ease-out) 0.25s both; }
.hero__title .line--2 { animation: rise 1s var(--ease-out) 0.4s both; }
.hero__title .line--3 { animation: rise 1s var(--ease-out) 0.55s both; }
.hero__footer { animation: rise 0.9s var(--ease-out) 0.7s both; }
.hero__meta .meta-block:nth-child(1) { animation: rise 0.7s var(--ease-out) 0.4s both; }
.hero__meta .meta-block:nth-child(2) { animation: rise 0.7s var(--ease-out) 0.5s both; }
.hero__meta .meta-block:nth-child(3) { animation: rise 0.7s var(--ease-out) 0.6s both; }
.hero__meta .meta-block:nth-child(4) { animation: rise 0.7s var(--ease-out) 0.7s both; }
.hero__rule { animation: fade 1s var(--ease-out) 0.9s both; }

@keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ======================================================================
   RESPONSIVE
   ====================================================================== */
@media (max-width: 1100px) {
    .hero__grid { grid-template-columns: 160px 1fr; gap: 2.5rem; }
    .about__grid { grid-template-columns: 1fr 1.4fr; gap: 3rem; }
    .about__sidebar {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid var(--paper-line);
        padding-top: 2rem;
        margin-top: 1rem;
    }
    .about__sidebar .sidebar-block { flex: 1 1 200px; }

    .approach__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    :root { --gutter: 1.5rem; }

    .nav__links { display: none; }
    .nav__menu-btn { display: flex; }

    .section-head {
        grid-template-columns: auto auto 1fr;
        gap: 1rem;
        padding: 4rem 0 2rem;
    }
    .section-meta { grid-column: 1 / -1; padding-top: 0.5rem; }

    .hero { padding-top: 2rem; }
    .hero__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .hero__meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem 2rem;
        border-right: 0;
        border-bottom: 1px solid var(--paper-line);
        padding-right: 0;
        padding-bottom: 1.5rem;
    }
    .hero__meta .meta-block { flex: 1 1 130px; }

    .hero__footer {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero__rule {
        grid-template-columns: auto 1fr auto;
        font-size: 0.6rem;
        gap: 0.75rem;
    }
    .hero__rule .rule-label:nth-child(3),
    .hero__rule .rule-text:nth-child(4) { display: none; }

    .about__grid { grid-template-columns: 1fr; gap: 2rem; }
    .about__intro { position: static; }
    .about__sidebar { flex-direction: column; }

    .project, .project--reverse {
        grid-template-columns: 40px 1fr;
        gap: 1.5rem;
        padding: 3.5rem 0;
    }
    .project__num {
        writing-mode: horizontal-tb;
        transform: none;
        height: auto;
    }
    .project__visual, .project--reverse .project__visual {
        grid-column: 2 / -1;
        order: 1;
    }
    .project__info, .project--reverse .project__info {
        grid-column: 2 / -1;
        order: 2;
    }

    .capabilities__grid { grid-template-columns: 1fr; gap: 2rem; }

    .approach__grid { grid-template-columns: 1fr; }
    .principle { min-height: auto; padding: 2rem 1.5rem; }

    .currently__grid { grid-template-columns: 1fr; }

    .contact__main { padding: 2rem 0; }
    .contact__email {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .contact__email-arrow { justify-self: end; margin-top: -1rem; }
    .contact__channels {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    .channel { border-right: 0; padding-right: 0; }

    .footer__top { padding-bottom: 3rem; }
    .footer__mark { font-size: 3rem; }
    .footer__bottom { font-size: 0.6rem; }

    .ai-pipeline {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .pipeline-arrow { transform: rotate(90deg); }

    .vis-grid { grid-template-rows: 1fr 1fr 1fr; }
    .vis-num { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .hero__title { font-size: clamp(2.5rem, 14vw, 4rem); }
    .nav__inner { padding: 1rem var(--gutter); }
    .monogram__sub { display: none; }
    .ticker__track { font-size: 0.65rem; }
    .footer__top {
        flex-direction: column;
        gap: 2rem;
        align-items: flex-start;
    }
}
