/* Zahra Tarkhani — live-terminal hero on a dark modern page. */

@font-face { font-family: "Mono"; src: url("fonts/mono.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Mono"; src: url("fonts/mono-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #0b0e0c;
  --panel: #0f1311;
  --panel-2: #0c100e;
  --rule: #1f2621;
  --text: #d7ddd4;
  --muted: #7f887d;
  --green: #7CE38B;   /* prompt */
  --amber: #E8B864;   /* name / accent */
  --cyan: #74d6c6;    /* links */
  --mono: "Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --maxw: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; overflow-anchor: none; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--amber); color: var(--bg); padding: .5rem .75rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 9; }
code { font-family: var(--mono); color: var(--amber); }

/* ---------- Terminal hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; padding: clamp(1.25rem, 5vw, 4rem); }
.term {
  width: min(860px, 100%);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 30px 80px -40px #000, inset 0 1px 0 #ffffff0a;
  overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--rule); background: #0e120f; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.r { background: #ec6a5e; } .dot.y { background: #f3bf4f; } .dot.g { background: #61c554; }
.term-title { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-left: .5rem; }
.term-screen { font-family: var(--mono); font-size: clamp(.86rem, 1.7vw, 1rem); line-height: 1.75; padding: 1.2rem 1.3rem .4rem; min-height: 15.5rem; }
.ln { white-space: pre-wrap; word-break: break-word; }
.ln.out { color: var(--text); }
.pr { color: var(--green); }
.ln .nm { color: var(--amber); font-weight: 700; }
.ln .cy { color: var(--cyan); }
.ln .mut { color: var(--muted); }
.caret { display: inline-block; width: .6ch; height: 1.15em; background: var(--amber); vertical-align: -.2em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.term-input { display: flex; align-items: center; gap: .6ch; padding: .3rem 1.3rem 1.2rem; font-family: var(--mono); font-size: clamp(.86rem, 1.7vw, 1rem); }
.term-input .pr { flex: none; }
.term-input input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; caret-color: var(--amber); }
.term-input input:focus { outline: none; }
.term-input input::placeholder { color: var(--muted); }
.hint { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin: 0; }

/* photo window sits behind the terminal, like two windows on a desktop */
.hero-grid { width: min(1180px, 100%); display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: center; }
.hero-grid .term { width: 100%; position: relative; z-index: 2; margin-left: -28px; width: calc(100% + 28px); }
.photo-win { margin: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px -36px #000; transform: translateY(-34px); position: relative; z-index: 1; }
.photo-win img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.term-screen .ln.para { margin-top: .55rem; }
.hero-grid .term-screen { min-height: 29rem; }
@media (max-width: 860px) { .hero-grid .term-screen { min-height: 0; } }
@media (max-width: 860px) {
  .hero { justify-content: flex-start; padding-top: 1.5rem; }
  .hero-grid { grid-template-columns: 1fr; justify-items: start; }
  .photo-win { width: 150px; transform: none; margin: 0 0 -18px 14px; }
  .photo-win .term-title { display: none; }
  .hero-grid .term { margin-left: 0; width: 100%; }
}
.hint code { color: var(--green); }

/* ---------- Sections ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 2rem); }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--rule); }
.lbl { font-family: var(--mono); font-size: .95rem; color: var(--text); margin-bottom: 1.75rem; letter-spacing: .02em; }
.lbl .pr { color: var(--green); }

.prose { max-width: 64ch; }
.prose p { margin: 0 0 1.1rem; }
.prose em { font-style: normal; color: var(--amber); font-family: var(--mono); font-size: .95em; }

.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem 2rem; }
.sk { border-top: 2px solid var(--rule); padding-top: .85rem; }
.sk h3 { font-family: var(--mono); font-weight: 700; font-size: 1rem; margin: 0 0 .45rem; color: var(--amber); }
.sk p { margin: 0; color: var(--muted); font-size: .97rem; line-height: 1.55; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1.25rem; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.rows li:last-child { border-bottom: 0; }
.when { font-family: var(--mono); color: var(--muted); font-size: .95rem; }
.what a { color: var(--text); }
.what a:hover { color: var(--cyan); }
.meta { display: block; color: var(--muted); font-size: .92rem; margin-top: .15rem; }
.service { margin: 1.5rem 0 0; color: var(--muted); font-size: .92rem; max-width: 64ch; }

.contact-body .mail { font-family: var(--mono); font-size: clamp(1.3rem, 3.5vw, 2rem); margin: 0 0 .6rem; }
.contact-body .mail a { color: var(--amber); }
.contact-body .links { margin: 0 0 1.75rem; }
.contact-body .aside { color: var(--muted); margin: 0 0 .4rem; }
.contact-body .small { font-family: var(--mono); color: var(--muted); font-size: .85rem; margin: 0; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .skills { grid-template-columns: 1fr; }
  .rows li { grid-template-columns: 1fr; gap: .15rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- About (photo + prose) ---------- */
.about { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(1.25rem, 4vw, 2.5rem); align-items: start; }
.portrait { width: 190px; height: 190px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); filter: saturate(.95); }
@media (max-width: 640px) { .about { grid-template-columns: 1fr; } .portrait { width: 150px; height: 150px; } }

/* ---------- Publications: expandable cards ---------- */
.lbl-note { color: var(--muted); font-size: .8rem; font-weight: 400; }
.pubs { border-top: 1px solid var(--rule); }
.pub { border-bottom: 1px solid var(--rule); }
.pub > summary {
  list-style: none; cursor: pointer; display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: 1rem; align-items: baseline;
  padding: .95rem 0; transition: color .15s;
}
.pub > summary::-webkit-details-marker { display: none; }
.pub > summary:hover .ti { color: var(--cyan); }
.pub > summary:hover { color: var(--cyan); }
.pub .yr { font-family: var(--mono); color: var(--muted); font-size: .95rem; }
.pub .ti { font-family: var(--sans); font-weight: 500; color: var(--text); line-height: 1.4; }
.pub .vn { font-family: var(--mono); color: var(--muted); font-size: .82rem; text-align: right; white-space: nowrap; }
.pub[open] > summary .ti { color: var(--amber); }
.pub .ti::before { content: "▸ "; color: var(--green); font-family: var(--mono); }
.pub[open] .ti::before { content: "▾ "; }
.pb { padding: .25rem 0 1.6rem 4.5rem; max-width: 66ch; }
.pb .sum { margin: 0 0 1.1rem; color: var(--text); }
.pb .quote { margin: .4rem 0 1.1rem; padding-left: 1rem; border-left: 2px solid var(--amber); color: var(--amber); font-family: var(--mono); font-size: .95rem; }
.pb .ln2 { margin: 1.1rem 0 0; font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.pb .ln2 a { color: var(--green); }

.stats { display: flex; flex-wrap: wrap; gap: 1.5rem 2.25rem; margin: 0 0 1.2rem; }
.stat b { display: block; font-family: var(--mono); font-weight: 700; font-size: 1.5rem; color: var(--amber); line-height: 1.1; }
.stat span { display: block; color: var(--muted); font-size: .85rem; max-width: 22ch; margin-top: .2rem; }

.viz { margin: 0 0 .4rem; max-width: 420px; }
.viz svg { width: 100%; height: auto; overflow: visible; }
.viz .vl { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.viz .vn2, .viz .vt { font-family: var(--mono); font-size: 11px; fill: var(--text); }
.viz .vt { fill: var(--muted); }
.viz .track { fill: #1a211c; }
.viz .fill.ok { fill: var(--green); }
.viz .fill.mid { fill: var(--amber); }
.viz .fill.bad { fill: #ec6a5e; }
.viz .axis { stroke: #1a211c; stroke-width: 2; }
.viz .dot.ok { fill: var(--green); } .viz .dot.mid { fill: var(--amber); } .viz .dot.bad { fill: #ec6a5e; }

@media (max-width: 640px) {
  .pub > summary { grid-template-columns: 3rem 1fr; }
  .pub .vn { grid-column: 2; text-align: left; margin-top: -.3rem; }
  .pb { padding-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .pub[open] .pb { animation: unfold .25s ease; }
  @keyframes unfold { from { opacity: 0; transform: translateY(-4px); } }
}

/* Paper figures: light plate so white scientific figures sit cleanly on the dark page */
.plate { background: #f6f6f1; border: 1px solid var(--rule); border-radius: 8px; padding: 14px 14px 10px; margin: 0 0 1.4rem; max-width: 720px; }
.plate img { display: block; width: auto; height: auto; max-width: 100%; max-height: 440px; margin: 0 auto; border-radius: 3px; }
.plate figcaption { font-family: var(--mono); font-size: .76rem; line-height: 1.5; color: #4d524b; margin-top: .65rem; padding-top: .55rem; border-top: 1px solid #e2e2da; }
.plate figcaption span { color: #979a90; }

/* Card body: lead, then man-page style key parts */
.pb { max-width: 760px; }
.pb .lead { margin: 0 0 1.15rem; font-size: 1.06rem; line-height: 1.6; color: var(--text); }
.kp { margin: 0 0 1.1rem; padding: 0; display: grid; gap: .7rem; }
.kp > div { display: grid; grid-template-columns: 7.75rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
.kp dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--green); }
.kp dd { margin: 0; color: #c3cac0; font-size: .98rem; line-height: 1.58; }
.kp ul { margin: 0; padding: 0; list-style: none; }
.kp li { position: relative; padding-left: 1.2rem; margin: 0 0 .35rem; }
.kp li:last-child { margin-bottom: 0; }
.kp li::before { content: "→"; position: absolute; left: 0; top: .05em; color: var(--amber); font-family: var(--mono); font-size: .85em; }
.xall { margin-left: .75rem; background: none; border: 1px solid var(--rule); border-radius: 4px; color: var(--muted); font: inherit; font-size: .78rem; padding: .1rem .5rem; cursor: pointer; }
.xall:hover { color: var(--green); border-color: var(--green); }
.plate a { display: block; cursor: zoom-in; }
@media (max-width: 640px) {
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
  .stat b { font-size: 1.12rem; }
  .stat span { font-size: .74rem; line-height: 1.35; }
  .kp > div { grid-template-columns: 1fr; gap: .15rem; }
  .plate { padding: 10px 10px 8px; }
  .plate img { max-height: none; }
}
