/* ==========================================================================
   Nayab Gauhar
   Two typefaces, one ink, one accent. Restraint is the design.
   ========================================================================== */

:root {
  --paper:      #faf9f7;
  --rule:       #e2ded7;
  --rule-soft:  #ebe7e0;

  --ink:        #17181a;
  --ink-2:      #4a4d52;
  --ink-3:      #666b73;

  --accent:     #9a3412;   /* burnt sienna, used sparingly */

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino,
           Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 68ch;
  --maxw:    1080px;
  --gutter:  clamp(1.5rem, 5vw, 3rem);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

html[data-theme="dark"] {
  --paper:      #111113;
  --rule:       #2b2d31;
  --rule-soft:  #232529;

  --ink:        #eceae6;
  --ink-2:      #b0aeaa;
  --ink-3:      #85837f;

  --accent:     #e8916a;
}

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
  overflow-x: hidden;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
::selection { background: var(--accent); color: var(--paper); }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 90;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 1rem; }

.label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.top.stuck { border-bottom-color: var(--rule); }

.top__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 62px;
}

.sig {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.sig em {
  font-style: normal;
  color: var(--ink-3);
  font-size: 0.92rem;
  margin-left: 0.5rem;
}

.menu { display: flex; align-items: center; gap: 1.4rem; }
.menu a {
  position: relative;
  font-size: 0.88rem;
  color: var(--ink-2);
  padding-block: 0.25rem;
  transition: color 0.2s var(--ease);
}
.menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: currentColor;
  transition: right 0.28s var(--ease);
}
.menu a:hover { color: var(--ink); }
.menu a:hover::after { right: 0; }
.menu a.on { color: var(--ink); }
.menu a.on::after { right: 0; background: var(--accent); }

.top__act { display: flex; align-items: center; gap: 0.5rem; }

.ghost-btn {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.ghost-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.ghost-btn svg { width: 15px; height: 15px; }

.i-sun { display: none; }
html[data-theme="dark"] .i-sun { display: block; }
html[data-theme="dark"] .i-moon { display: none; }

.burger { display: none; }

/* ---------- Links & buttons ---------- */
.ul {
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.ul:hover { border-bottom-color: var(--accent); color: var(--accent); }

.act {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  padding: 0.6rem 1.05rem;
  border: 1px solid var(--ink);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.act svg { width: 15px; height: 15px; }
.act--solid { background: var(--ink); color: var(--paper); }
.act--solid:hover { background: var(--accent); border-color: var(--accent); }
.act--line { border-color: var(--rule); color: var(--ink-2); }
.act--line:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Section rhythm ---------- */
.sec { padding-block: clamp(4rem, 8vw, 6.5rem); }
.sec + .sec { padding-top: 0; }

.sec__head {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.sec__head h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
/* The lede is a third grid row under the title, not a sibling pushed down by
   the baseline alignment of the row above it. */
.sec__head { grid-template-rows: auto auto; }
.sec__head p {
  grid-column: 2;
  grid-row: 2;
  color: var(--ink-2);
  max-width: 52ch;
  margin-top: 0.45rem;
  font-size: 0.98rem;
}

/* ---------- Intro ---------- */
.intro { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 6vw, 5rem); }

.intro__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: start;
}

.intro__avail {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.75rem;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.intro h1 {
  font-family: var(--serif);
  font-size: clamp(2.15rem, 5.6vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
  max-width: 22ch;
  margin-bottom: 1.5rem;
}
.intro h1 em {
  font-style: italic;
  color: var(--accent);
}

.intro__sub {
  font-size: 1.06rem;
  color: var(--ink-2);
  max-width: 54ch;
}
.intro__sub + .intro__sub { margin-top: 0.9rem; }
.intro__sub strong { color: var(--ink); font-weight: 500; }

.intro__act {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 2rem;
}

.portrait {
  width: clamp(150px, 20vw, 208px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--rule);
  flex-shrink: 0;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Fact row ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 2rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
.facts div .label { display: block; margin-bottom: 0.4rem; }
.facts div p {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.4;
}
.facts div p a { border-bottom: 1px solid var(--rule); }
.facts div p a:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* ---------- Prose ---------- */
.prose {
  max-width: var(--measure);
  font-size: 1.06rem;
}
.prose p + p { margin-top: 1.15rem; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 500; }
.prose em { color: var(--ink); }

/* ---------- Entries (experience) ---------- */
.entry {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  padding-block: 1.9rem;
  border-top: 1px solid var(--rule-soft);
}
.entry:first-child { border-top: 0; padding-top: 0; }

.entry__when {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  padding-top: 0.3rem;
  line-height: 1.6;
}
.entry__when .now { color: var(--accent); }

.entry__role {
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.entry__org {
  font-size: 0.92rem;
  color: var(--ink-3);
  margin-top: 0.2rem;
  margin-bottom: 0.85rem;
}
.entry__org b { color: var(--ink-2); font-weight: 500; }

.notes { display: grid; gap: 0.5rem; max-width: 60ch; }
.notes li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.notes li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 4px; height: 1px;
  background: var(--ink-3);
}
.notes strong { color: var(--ink); font-weight: 500; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
  margin-top: 0.95rem;
}
.tags li {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.tags li + li::before {
  content: "·";
  margin-right: 0.75rem;
  color: var(--rule);
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin-bottom: 2.25rem;
}
.filters button {
  font-size: 0.87rem;
  color: var(--ink-3);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Work ---------- */
.works { display: grid; }

.work {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  padding-block: 2rem;
  border-top: 1px solid var(--rule-soft);
}
.work:first-child { border-top: 0; padding-top: 0; }
.work.off { display: none; }

.work__kind {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.35rem;
}

.work__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}
.work__name {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.work__name a { display: inline-flex; align-items: baseline; gap: 0.45rem; }
.work__name a:hover { color: var(--accent); }
.work__name svg {
  width: 13px; height: 13px;
  color: var(--ink-3);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
  align-self: center;
}
.work__name a:hover svg { color: var(--accent); transform: translate(1px, -1px); }

.work__out {
  font-size: 0.82rem;
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.work__out a:hover { color: var(--accent); }

.work__desc {
  margin-top: 0.6rem;
  color: var(--ink-2);
  font-size: 0.98rem;
  max-width: 62ch;
}

.work__points {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.9rem;
  max-width: 60ch;
}
.work__points li {
  font-size: 0.92rem;
  color: var(--ink-2);
  padding-left: 1.1rem;
  position: relative;
}
.work__points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7em;
  width: 4px; height: 1px;
  background: var(--ink-3);
}
.work__points strong {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- Skills ---------- */
.kit { display: grid; gap: 0; }
.kit__row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  padding-block: 1.35rem;
  border-top: 1px solid var(--rule-soft);
  align-items: baseline;
}
.kit__row:first-child { border-top: 0; padding-top: 0; }
.kit__row h3 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}
.kit__row p {
  color: var(--ink-2);
  font-size: 0.95rem;
  max-width: 62ch;
}

/* ---------- Awards ---------- */
.wins { display: grid; }
.win {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  padding-block: 1.6rem;
  border-top: 1px solid var(--rule-soft);
}
.win:first-child { border-top: 0; padding-top: 0; }
.win__place {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-top: 0.3rem;
}
.win h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.win__where { font-size: 0.86rem; color: var(--ink-3); margin-top: 0.15rem; }
.win p.win__note {
  color: var(--ink-2);
  font-size: 0.93rem;
  margin-top: 0.55rem;
  max-width: 60ch;
}
.win__note strong { color: var(--ink); font-weight: 500; }

/* ---------- Contact ---------- */
.reach { padding-top: 0; }
.reach__in {
  padding-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
}
.reach h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 26ch;
}
.reach h2 em { font-style: italic; color: var(--accent); }
.reach__lede {
  color: var(--ink-2);
  margin-top: 1.1rem;
  max-width: 56ch;
  font-size: 1.04rem;
}
.reach__lede strong { color: var(--ink); font-weight: 500; }

.reach__act { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.9rem; }

.lines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem 2rem;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule-soft);
}
.lines .label { display: block; margin-bottom: 0.3rem; }
.lines a, .lines span.val {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  display: inline-block;
}
.lines a { border-bottom: 1px solid var(--rule); }
.lines a:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-block: 1.75rem;
}
.foot__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.84rem;
  color: var(--ink-3);
}
.foot__in nav { display: flex; gap: 1.15rem; }
.foot__in nav a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .up { opacity: 0; transform: translateY(12px); }
  .up.in {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .burger { display: grid; }
  .menu {
    position: fixed;
    inset: 62px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.32s var(--ease), opacity 0.32s var(--ease);
  }
  .menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .menu a {
    padding-block: 0.7rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--rule-soft);
  }
  .menu a::after { display: none; }
  .menu a.on { color: var(--accent); }

  .intro__grid { grid-template-columns: 1fr; gap: 2rem; }
  .portrait { order: -1; width: 116px; }

  .sec__head,
  .entry, .work, .kit__row, .win { grid-template-columns: 1fr; gap: 0.5rem; }
  .sec__head { gap: 0.35rem; }
  .sec__head p { grid-column: 1; }
  .entry__when, .work__kind, .win__place { padding-top: 0; }
  .kit__row { gap: 0.4rem; }

  .work__head { flex-direction: column; gap: 0.3rem; }
  .work__out { white-space: normal; }
}

@media (max-width: 700px) {
  /* Three cells in two columns leave an orphan; stack instead. */
  .facts { grid-template-columns: 1fr; gap: 1.15rem; }
}

@media (max-width: 460px) {
  .sig em { display: none; }
  .intro__act .act { flex: 1 1 100%; justify-content: center; }
}

@media print {
  .top, .skip, .filters, .intro__act, .reach__act, .foot, .portrait { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .sec { padding-block: 0.9rem; }
  .entry, .work, .win { break-inside: avoid; }
  a { color: #000; }
}
