:root {
  color-scheme: light;
  --bg: var(--portfolio-paper);
  --surface: var(--portfolio-surface);
  --ink: var(--portfolio-ink);
  --muted: var(--portfolio-muted);
  --line: var(--portfolio-line);
  --accent: var(--portfolio-purple);
  --mono: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  isolation: isolate;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.85 Vazirmatn, sans-serif;
}

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ol, ul, dl, dd { margin: 0; }
button { font: inherit; }
section[id], article[id] { scroll-margin-top: 28px; }
.shell { width: min(1280px, calc(100% - 112px)); margin-inline: auto; }
.mono, .eyebrow { font-family: var(--mono); letter-spacing: .12em; }
.skip { position: absolute; z-index: 2; top: 12px; right: 12px; padding: 8px 16px; background: var(--accent); color: #fff; }
.skip:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; padding: 0; }

.site-header {
  display: grid;
  direction: ltr;
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
}
.brand { display: block; width: clamp(132px, 15vw, 202px); justify-self: start; }
.brand img { display: block; width: 100%; height: auto; filter: brightness(0) opacity(.85); }
.brand-dot, h1 span, .contact-panel h2 span { color: var(--accent); }
.site-header a:hover, .site-footer a:hover { color: var(--accent); }

.hero { display: grid; align-items: center; gap: clamp(12px, 4vw, 64px); padding-block: clamp(24px, 4vw, 56px); }
.hero.has-handoff-visual { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.hero-copy { max-width: 570px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: .71rem; line-height: 1.4; font-weight: 500; }
.signal { width: 6px; height: 6px; flex: 0 0 6px; background: currentColor; box-shadow: 0 0 12px #5746b633; }
h1, h2 { font-weight: 800; line-height: 1.16; }
h1 { margin-block: 0 9px; font-size: clamp(2.65rem, 6.8vw, 5.7rem); letter-spacing: -.032em; }
.hero-role { font-size: clamp(1.05rem, 2.03vw, 1.55rem); font-weight: 600; color: var(--muted); }
.hero-description { color: var(--muted); max-width: 38ch; margin-block-start: 19px; font-size: 1.04rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 25px; margin-top: 29px; }
.button { min-height: 49px; display: inline-flex; justify-content: center; align-items: center; gap: 13px; padding: 8px 17px; font-weight: 650; font-size: .91rem; border: 1px solid transparent; transition: background-color .18s, color .18s; }
.button-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button-primary:hover { background: var(--portfolio-purple-hover); }
.button-text { padding-inline: 0; color: var(--ink); }
.button-text:hover, .button-text span { color: var(--accent); }


.section { padding-block-start: clamp(68px, 9vw, 123px); }
#work { padding-block-start: clamp(22px, 4vw, 56px); border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1.12fr .88fr; align-items: end; gap: 20px 32px; margin-bottom: 31px; }
.section-heading p:not(.eyebrow) { color: var(--muted); max-width: 40ch; justify-self: end; }
h2 { margin-top: 15px; font-size: clamp(2.45rem, 4.45vw, 4.4rem); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.project { min-width: 0; background: var(--surface); border: 1px solid var(--line); transition: border-color .18s; }
.project:hover, .project:focus-within, .project:target { border-color: var(--accent); }
.project-figure {
  display: grid;
  align-items: center;
  height: clamp(155px, 16.4vw, 208px);
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 50%, var(--glow), transparent 75%), radial-gradient(circle, #5746b629 1px, transparent 1px) 0 0 / 15px 15px, #eeebf4;
  border-bottom: 1px solid var(--line);
  direction: ltr;
}
.figure-delivery { --glow: #d9d0ee; }
.figure-platform { --glow: #dfd8f3; }
.figure-signals { --glow: #e0d5ed; }
.figure-resilience { --glow: #e2daef; }
.project-figure svg { display: block; width: min(100%, 460px); max-height: 100%; margin-inline: auto; }
.figure-type { position: absolute; inset-inline-end: 12px; bottom: 11px; color: #514a67; font: 400 .62rem var(--mono); letter-spacing: .1em; }
.project-copy { padding: 21px 23px 16px; }
.project-copy h3, .timeline h3 { font-size: clamp(1.18rem, 2.1vw, 1.57rem); font-weight: 750; line-height: 1.55; }
.project-copy p { margin-top: 5px; color: var(--muted); font-size: .93rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.tags li { background: var(--portfolio-lavender); border: 1px solid #d8d0ed; color: #4d3b9d; font: 400 .72rem/1.55 var(--mono); padding: 3px 8px; }
.project-copy .tags { justify-content: flex-end; margin-top: 17px; }
.project details { border-top: 1px solid var(--line); margin-top: 17px; }
.project summary { display: flex; justify-content: space-between; align-items: center; min-height: 44px; cursor: pointer; list-style: none; color: var(--accent); font-size: .87rem; font-weight: 600; }
.project summary::-webkit-details-marker { display: none; }
.project summary::after { content: "+"; font: 500 1.1rem var(--mono); }
.project details[open] summary::after { content: "−"; }
.project dl { display: grid; gap: 11px; margin: 8px 0 10px; font-size: .88rem; }
.project dt { color: var(--ink); font-weight: 700; }
.project dd { color: var(--muted); }

.timeline { list-style: none; padding: 0 18px 0 0; border-top: 1px solid var(--line); position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent) calc(var(--flht-trace, 1) * 100%), var(--line) 0);
}
.timeline li { display: grid; grid-template-columns: 116px minmax(0, 1fr) 160px; gap: 18px; align-items: center; padding-block: 20px; border-bottom: 1px solid var(--line); }
.date { color: var(--accent); font-size: .79rem; text-align: right; letter-spacing: 0; }
.timeline p { color: var(--muted); font-size: .91rem; }
.organization { color: var(--muted); font: 400 .79rem var(--mono); text-align: left; }
.credentials { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 15px; padding-top: 18px; color: var(--muted); font-size: .88rem; }
.contact-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 25px 44px;
  padding: clamp(23px, 5.6vw, 72px);
  border: 1px solid var(--line);
  background: repeating-linear-gradient(128deg, transparent 0 36px, #5746b615 37px 38px), radial-gradient(ellipse at 10% 14%, #ede8f6, var(--surface) 73%);
}
.contact-panel p:not(.eyebrow) { margin-top: 18px; color: var(--muted); }
.contact-links { display: grid; gap: 13px; }
.contact-links .button { font-family: var(--mono); }
.site-footer { direction: ltr; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; min-height: 70px; padding-block: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .77rem; }
.site-footer .mono { font-size: .64rem; }
.site-footer a { direction: rtl; }

@media (max-width: 1060px) {
  .shell { width: calc(100% - 72px); }
}
@media (max-width: 820px) {
  .shell { width: calc(100% - 46px); }
  .hero { align-items: center; }
  .hero-description { max-width: 47ch; }
}
@media (max-width: 575px) {
  .shell { width: calc(100% - 32px); }
  .site-header { min-height: 58px; }
  .brand { width: clamp(86px, 30vw, 132px); }
  .hero.has-handoff-visual { grid-template-columns: minmax(0, 1fr); }
  .hero .flht-handoff-visual svg { max-height: 115px; }
  .hero-description { margin-top: 12px; font-size: .96rem; }
  .hero-actions { gap: 10px 16px; margin-top: 17px; }
  .button { min-height: 44px; }
  .section-heading, .project-grid { grid-template-columns: 1fr; }
  .section-heading { margin-bottom: 20px; gap: 10px; }
  .section-heading p:not(.eyebrow) { justify-self: start; }
  .project-copy { padding: 15px 15px 10px; }
  .timeline li { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .timeline li div { grid-column: 1 / -1; grid-row: 2; }
  .timeline li .organization { grid-column: 2; grid-row: 1; }
  .timeline h3 { font-size: 1.11rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
