/* ============================================================
   Sâmya de Almeida — Portfolio System
   Editorial · warm paper · expressive motion
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  /* Base palette — inherits CV DNA */
  --paper:         #FEF8E4;
  --paper-soft:    #FFFCEF;
  --paper-deep:    #F8EED4;
  --ink:           #1A1814;
  --ink-soft:      #2E2C28;
  --ink-muted:     #4A463E;
  --muted:         #6E6A60;
  --muted-2:       #908B80;
  --rule:          #BDB6A8;
  --rule-soft:     #D4CEC0;

  /* Accent colors — one per project */
  --accent-ai:     #D97757;   /* AI Search — warm orange */
  --accent-class:  #5B7C5A;   /* Class Details — deep green */
  --accent-isa:    #3D5A80;   /* iSA TAT — aero blue */
  --accent:        var(--ink);

  /* Type scale (display: Instrument Serif italic) */
  --display-xl:    clamp(72px, 14vw, 220px);
  --display-l:     clamp(56px, 9vw, 140px);
  --display-m:     clamp(40px, 6vw, 88px);
  --display-s:     clamp(32px, 4.5vw, 64px);
  --headline:      clamp(24px, 2.4vw, 36px);
  --subhead:       clamp(18px, 1.4vw, 22px);
  --body-l:        clamp(16px, 1.15vw, 19px);
  --body:          15px;
  --small:         13px;
  --tiny:          11px;

  /* Motion tokens */
  --ease-out-quart:    cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-expo:  cubic-bezier(0.87, 0, 0.13, 1);

  /* Spacing */
  --gutter:        clamp(28px, 14vw, 240px);
  --section-y:     clamp(80px, 12vw, 180px);
  --max-w:         1080px;
}

@media (max-width: 600px) {
  :root {
    --gutter: 32px;
    --motion-scale: 1.4;
  } 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html { background: var(--paper); }

html, body {
  color: var(--ink);
  font-family: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
  position: relative;
}

/* Global noise texture — subtle grain on the page background, behind content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.95 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: multiply;
}

body.no-scroll { overflow: hidden; }

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

button { font: inherit; background: none; border: 0; color: inherit; cursor: none; }

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

/* Global em — inline emphasis uses italic of body font, not serif swap.
   The big display moments (.hero-name, .case-title, .talk-heading) keep serif italic. */
em { font-style: italic; font-weight: 500; font-family: inherit; color: var(--ink); }

/* ============================================================
   Custom cursor
   ============================================================ */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  opacity: 0;
  transition: transform 0.18s var(--ease-out-quart),
              width 0.25s var(--ease-out-quart),
              height 0.25s var(--ease-out-quart),
              opacity 0.25s var(--ease-out-quart),
              border-color 0.25s var(--ease-out-quart);
}
body.cursor-ready .cursor-dot,
body.cursor-ready .cursor-ring { opacity: 1; }

.cursor-dot {
  width: 6px; height: 6px;
  background: var(--paper);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(244, 241, 234, 0.55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

body.cursor-hover .cursor-ring {
  width: 64px; height: 64px;
  border-color: var(--paper);
  background: rgba(244, 241, 234, 0.06);
}
body.cursor-hover .cursor-dot { opacity: 0; }

body.cursor-text .cursor-ring {
  width: 4px; height: 36px;
  border-radius: 2px;
  background: var(--paper);
  border-color: transparent;
}
body.cursor-text .cursor-dot { opacity: 0; }

body.cursor-view .cursor-ring {
  width: 96px; height: 96px;
  background: var(--ink);
  border-color: var(--ink);
  mix-blend-mode: normal;
}
body.cursor-view .cursor-dot { opacity: 0; }
body.cursor-view .cursor-ring::after {
  content: "VIEW";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--paper);
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
  a, button { cursor: pointer; }
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px calc(var(--gutter) + max(0px, (100vw - var(--max-w) - 480px) / 2));
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--ink);
  border-bottom: 1px solid rgba(244, 241, 234, 0.08);
  transition: border-color 0.4s var(--ease-out-quart);
}
.nav.scrolled {
  border-bottom-color: rgba(244, 241, 234, 0.18);
}

.nav .brand {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--paper);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
  color: var(--paper);
}

.nav-link {
  position: relative;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 4px 0;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.5s var(--ease-out-expo);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left center; }

/* Language toggle — CV-style pill, with subtle glass */
.lang-toggle {
  display: inline-flex;
  border: 1px solid rgba(244, 241, 234, 0.3);
  border-radius: 999px;
  padding: 3px;
  font-family: "Geist Mono", monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  background: rgba(244, 241, 234, 0.1);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
.lang-toggle button {
  padding: 6px 13px;
  border-radius: 999px;
  color: rgba(244, 241, 234, 0.92);
  transition: background 0.25s var(--ease-out-quart),
              color 0.25s var(--ease-out-quart);
}
.lang-toggle button.active {
  background: var(--paper);
  color: var(--ink);
}

/* ============================================================
   Reusable
   ============================================================ */
.label {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.rule {
  height: 1px;
  background: var(--rule);
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
}

.serif-italic {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ============================================================
   Sections — max-width container for big monitors
   ============================================================ */
.section {
  padding: var(--section-y) var(--gutter);
  max-width: calc(var(--max-w) + 2 * 240px);
  margin-left: auto;
  margin-right: auto;
}

/* Alt section — full-bleed paper-deep bg for rhythm */
.section.alt {
  position: relative;
  max-width: none;
  padding-left: max(var(--gutter), calc(50vw - var(--max-w) / 2 - 0px));
  padding-right: max(var(--gutter), calc(50vw - var(--max-w) / 2 - 0px));
  background: var(--paper-deep);
}
.section.alt > * {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  padding-bottom: 28px;
  margin-bottom: 24px;
}

.section-title {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  font-size: var(--display-m);
  line-height: 0.95;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.section-meta {
  font-family: "Geist Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 40px var(--gutter);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer a:hover { color: var(--ink); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .section-head {
    grid-template-columns: 1fr;
  }
  .section-meta { text-align: left; }
  .nav-links { gap: 14px; }
  .nav-link:not(.lang-toggle button) { display: none; }
}

/* ============================================================
   Case Study — shared chrome (used by /work/*.html)
   ============================================================ */
.case {
  padding-top: 96px;
  max-width: calc(var(--max-w) + 2 * 240px);
  margin-left: auto;
  margin-right: auto;
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 var(--gutter) 32px;
  font-family: "Geist Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  transition: color 0.3s var(--ease-out-quart), gap 0.4s var(--ease-out-quart);
}
.case-back:hover { color: var(--ink); gap: 14px; }

.case-hero {
  padding: 32px var(--gutter) 80px;
  border-bottom: 1px solid var(--rule);
}

.case-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 56px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.case-meta-row .item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.case-meta-row .lbl {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-meta-row .val {
  font-size: 14px;
  color: var(--ink);
}

.case-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent, var(--muted));
  margin-bottom: 24px;
}
.case-eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: currentColor;
}

.case-title {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(48px, 6.4vw, 96px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  color: var(--ink);
  max-width: 24ch;
  text-wrap: pretty;
}

.case-lead {
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.45;
  color: var(--ink-muted);
  max-width: 56ch;
  text-wrap: pretty;
  font-weight: 300;
}
.case-lead em {
  font-family: inherit;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}

/* Case body sections */
.case-section {
  padding: clamp(80px, 10vw, 140px) var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.case-section:last-of-type { border-bottom: none; }

.case-section.dark {
  background: var(--ink);
  color: var(--paper);
  /* full-bleed for dark sections by extending past parent's max-width */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(var(--gutter), calc(50vw - var(--max-w) / 2));
  padding-right: max(var(--gutter), calc(50vw - var(--max-w) / 2));
}
.case-section.dark .case-section-label { color: rgba(244,241,234,0.6); }
.case-section.dark .case-section-label::before { background: currentColor; }
.case-section.dark .case-section-title { color: var(--paper); }
.case-section.dark .case-body { color: rgba(244,241,234,0.85); }

.case-section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  align-items: start;
  margin-bottom: 56px;
}

.case-section-label {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.case-section-label::before {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
}

.case-section-title {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 22ch;
  text-wrap: balance;
}

.case-body {
  max-width: 64ch;
  margin-left: 284px;
}
.case-body p {
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 18px;
  text-wrap: pretty;
}
.case-body p:last-child { margin-bottom: 0; }
.case-body p em {
  font-family: inherit;
  font-style: italic;
  font-weight: 500;
}
.case-body strong {
  font-weight: 500;
}

/* Mockup containers within case sections */
.case-figure {
  margin: 56px auto 0;
  max-width: 1100px;
  background: var(--paper-deep);
  border-radius: 8px;
  overflow: hidden;
  padding: 32px;
  border: 1px solid var(--rule);
}
.case-figure.dark { background: #0F1922; border-color: #1A2A38; }
.case-figure svg { display: block; margin: 0 auto; width: 100%; height: auto; }
.case-figure-caption {
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
}

/* Stat / metric callout */
.case-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 64px 0 0 284px;
  max-width: 800px;
}
.case-metric {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.case-metric .num {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.case-metric .lbl {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.case-section.dark .case-metric { border-top-color: rgba(244,241,234,0.2); }
.case-section.dark .case-metric .num { color: var(--paper); }
.case-section.dark .case-metric .lbl { color: rgba(244,241,234,0.6); }

@media (max-width: 880px) {
  .case-section-head { grid-template-columns: 1fr; gap: 24px; }
  .case-body { margin-left: 0; }
  .case-metrics { margin-left: 0; grid-template-columns: 1fr; }
  .case-meta-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Password gate (iSA TAT)
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}
.gate-panel {
  width: min(440px, 100%);
  text-align: center;
}
.gate-icon {
  width: 56px; height: 56px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.gate-label {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.gate-title {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
  color: var(--ink);
}
.gate-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-bottom: 32px;
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gate-input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-soft);
  font-family: "Geist", sans-serif;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.25s var(--ease-out-quart),
              background 0.25s var(--ease-out-quart);
  text-align: center;
  letter-spacing: 0.02em;
}
.gate-input:focus {
  border-color: var(--ink);
  background: var(--paper);
}
.gate-input.shake {
  animation: shake 0.4s var(--ease-out-quart);
  border-color: #B33A3A;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.gate-submit {
  padding: 14px 22px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "Geist Mono", monospace;
  transition: background 0.25s var(--ease-out-quart);
}
.gate-submit:hover { background: var(--ink-soft); }
.gate-hint {
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 16px;
}
.gate-hint a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
body.gate-locked { overflow: hidden; }
body.gate-locked .case,
body.gate-locked .nav { display: none !important; }

/* ============================================================
   About page
   ============================================================ */
.about-hero {
  padding: 96px var(--gutter) 64px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.about-hero h1 {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: clamp(64px, 11vw, 180px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 14ch;
  text-wrap: balance;
}
.about-hero .label {
  margin-bottom: 14px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
  padding: 64px var(--gutter) 96px;
  border-top: 1px solid var(--rule);
}
.about-portrait {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about-portrait .frame {
  background: linear-gradient(135deg, #F4D9CE 0%, #FBE9D4 50%, #F0E0E8 100%);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
}
.about-portrait .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-portrait .caption {
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-story p {
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 22px;
  text-wrap: pretty;
  max-width: 56ch;
}
.about-story p:first-child {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}
.about-story p em {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
}

.timeline {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 24px;
  align-items: baseline;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule-soft);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-year {
  font-family: "Geist Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent-ai);
}
.timeline-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}
.timeline-text strong { font-weight: 500; }

@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 320px; }
}
