/* ==========================================================================
   Elham Dehghan — Portfolio
   One stylesheet. Neutral system, one accent. Light mode only, by design.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #f5f5f3;
  --surface-2: #ececea;
  --ink: #111111;
  --ink-2: #555555;
  --ink-3: #8a8a8a;
  --line: #e8e8e6;
  --accent: #1f7a5a; /* the only colour on the site */

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --w: 1120px;     /* page width */
  --w-text: 640px; /* reading measure */
  --gutter: clamp(20px, 5vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 12px;
  background: var(--ink); color: var(--bg);
  padding: 8px 12px; border-radius: 6px; font-size: 14px; z-index: 100;
}
.skip:focus { left: 12px; }

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

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}

.wordmark { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }

.nav { display: flex; gap: 28px; font-size: 15px; }
.nav a { color: var(--ink-2); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav .ext::after { content: " ↗"; font-size: .85em; color: var(--ink-3); }

.menu-btn {
  display: none;
  background: none; border: 0; padding: 8px; margin-right: -8px;
  font: inherit; font-size: 15px; color: var(--ink); cursor: pointer;
}

@media (max-width: 640px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .nav a { font-size: 22px; color: var(--ink); padding: 10px 0; letter-spacing: -0.02em; }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
}

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.muted { color: var(--ink-2); }

.link {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .35s var(--ease);
  padding-bottom: 1px;
}
.link:hover { background-size: 100% 1px; }

.arrow::after {
  content: "→"; display: inline-block; margin-left: .35em;
  transition: transform .3s var(--ease);
}
a:hover .arrow::after, .arrow:hover::after { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: clamp(72px, 14vw, 168px) 0 clamp(56px, 9vw, 104px); }

.hero h1 {
  font-size: clamp(34px, 5.4vw, 60px);
  letter-spacing: -0.035em;
  line-height: 1.06;
  max-width: 15ch;
}
.hero h1 .soft { color: var(--ink-3); }

.hero .lede {
  margin-top: 28px;
  max-width: 560px;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
}

.status {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 36px;
  font-size: 14px; color: var(--ink-2);
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(31, 122, 90, .45);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 122, 90, .45); }
  70% { box-shadow: 0 0 0 8px rgba(31, 122, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 122, 90, 0); }
}

/* --------------------------------------------------------------------------
   Facts strip  (Focus / Range / Open to)
   -------------------------------------------------------------------------- */
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.facts > div { padding: 22px 24px 24px 0; }
.facts dt { margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 15px; line-height: 1.5; }
@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; }
  .facts > div { padding: 18px 0; border-bottom: 1px solid var(--line); }
  .facts > div:last-child { border-bottom: 0; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section + .section { padding-top: 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.section-head a { font-size: 14px; color: var(--ink-2); }
.section-head a:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Project list  — stacked, one per row, cover + meta
   -------------------------------------------------------------------------- */
.projects { list-style: none; margin: 0; padding: 0; }

.project { border-bottom: 1px solid var(--line); }

.project a {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 4vw, 44px) 0;
}

.project .meta { display: flex; flex-direction: column; gap: 14px; }
.project .index { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.project h3 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.03em; }
.project .desc { color: var(--ink-2); font-size: 16px; max-width: 34ch; margin: 0; }
.project .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.project .cta { font-size: 14px; color: var(--ink); margin-top: 8px; }

/* Cover — a quiet typographic tile until real images arrive */
.cover {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background: var(--surface);
}
.cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease);
}
.cover-placeholder {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(18px, 2.4vw, 28px);
}
.cover-placeholder .mark {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 500; letter-spacing: -0.05em; line-height: 1;
  color: var(--ink);
  opacity: .9;
}
.cover-placeholder .note { display: flex; justify-content: space-between; }

/* Fine grid behind placeholder covers — feels like a canvas, not a gap */
.cover-placeholder::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--surface-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--surface-2) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 70% 60%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 60%, #000 0%, transparent 70%);
  opacity: .9;
}

.project a:hover .cover img { transform: scale(1.02); }
.project a:hover h3 { color: var(--ink); }

@media (max-width: 760px) {
  .project a { grid-template-columns: 1fr; gap: 20px; }
  .project .cover { order: -1; }
}

/* --------------------------------------------------------------------------
   Principles / How I work (short)
   -------------------------------------------------------------------------- */
.split {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 5vw, 80px);
}
.split h2 { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.split .big {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.35; letter-spacing: -0.02em; color: var(--ink);
  max-width: 28ch;
}
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(16px, 5vw, 80px);
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.rows .k { font-size: 15px; font-weight: 500; }
.rows .v { color: var(--ink-2); font-size: 16px; }
.rows .v p:last-child { margin: 0; }
@media (max-width: 760px) { .rows li { grid-template-columns: 1fr; gap: 6px; } }

/* --------------------------------------------------------------------------
   Prose pages (About)
   -------------------------------------------------------------------------- */
.page-head { padding: clamp(64px, 12vw, 140px) 0 clamp(40px, 6vw, 72px); }
.page-head h1 {
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.035em; line-height: 1.06;
  max-width: 18ch;
}
.page-head .lede { margin-top: 24px; max-width: 580px; color: var(--ink-2); font-size: 18px; }

.prose { max-width: var(--w-text); font-size: 18px; line-height: 1.7; }
.prose p { color: var(--ink); }

.portrait {
  aspect-ratio: 4 / 5; border-radius: 14px; background: var(--surface);
  overflow: hidden; position: relative;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .portrait { max-width: 280px; } }
.portrait .cover-placeholder .mark { font-size: 15px; letter-spacing: 0; font-weight: 400; color: var(--ink-3); }

/* Experience timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.timeline li {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 24px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.timeline .when { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.timeline .what strong { font-weight: 500; }
.timeline .what span { color: var(--ink-2); }
.timeline .where { color: var(--ink-3); font-size: 14px; }
@media (max-width: 640px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact-big {
  font-size: clamp(30px, 5.6vw, 64px);
  letter-spacing: -0.04em; line-height: 1.05; font-weight: 500;
  word-break: break-word;
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 24px;
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
  transition: background .2s;
}
.copy-btn:hover { background: var(--surface-2); }
.copy-btn[data-copied="true"] { color: var(--accent); }

.channels { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.channels a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(18px, 2vw, 22px); letter-spacing: -0.02em;
}
.channels a span:last-child { color: var(--ink-3); font-size: 15px; letter-spacing: 0; }
.channels a:hover span:first-child { color: var(--accent); }

/* --------------------------------------------------------------------------
   Case study shell (empty for now)
   -------------------------------------------------------------------------- */
.case-head { padding: clamp(56px, 10vw, 120px) 0 clamp(36px, 5vw, 56px); }
.case-head .back { font-size: 14px; color: var(--ink-2); display: inline-block; margin-bottom: 40px; }
.case-head .back:hover { color: var(--ink); }
.case-head h1 {
  font-size: clamp(40px, 6.4vw, 76px);
  letter-spacing: -0.045em; line-height: 1;
}
.case-head .outcome {
  margin-top: 24px; max-width: 30ch;
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -0.02em; line-height: 1.35; color: var(--ink-2);
}

.case-meta {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-bottom: clamp(40px, 6vw, 72px);
}
.case-meta > div { padding: 18px 20px 20px 0; }
.case-meta dt { margin-bottom: 6px; }
.case-meta dd { margin: 0; font-size: 15px; }
@media (max-width: 720px) { .case-meta { grid-template-columns: 1fr 1fr; } }

.case-hero { aspect-ratio: 16 / 9; border-radius: 16px; }

.in-progress {
  max-width: var(--w-text);
  margin: clamp(56px, 8vw, 96px) 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
}
.in-progress p { color: var(--ink-2); }

.next-case {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 36px 0 0;
}
.next-case a { font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.03em; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { padding: clamp(80px, 12vw, 140px) 0 40px; }

.footer-cta h2 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.035em; line-height: 1.1;
  max-width: 18ch;
}
.footer-cta h2 a { color: var(--ink-3); transition: color .2s; }
.footer-cta h2 a:hover { color: var(--ink); }

.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  margin-top: clamp(56px, 8vw, 96px); padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-3);
}
.footer-bottom nav { display: flex; gap: 24px; }
.footer-bottom a:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Reveal on scroll — subtle, and off for reduced motion
   -------------------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .menu-btn { display: none; }
  body { font-size: 12pt; }
}
