/* ============================================================
   MAJZOOB ALI — Drafting Table Portfolio (Version D Palette)
   Paper + vermillion + blueprint blue. Sharp edges. Mono data.
   ============================================================ */

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
  --paper:    #F2EDE3;
  --paper-2:  #FAF8F3;
  --paper-3:  #E8E1D3;
  --ink:      #16181D;
  --ink-2:    #5A6068;
  --ink-3:    #9DA3AB;
  --accent:   #C63D2F;
  --accent-2: #E04E3A;
  --blue:     #26426E;
  --line:     rgba(22,24,29,0.13);
  --line-2:   rgba(22,24,29,0.28);
  --grid:     rgba(38,66,110,0.055);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --r-sm: 2px;
  --r:    3px;
  --r-lg: 5px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:  0.55s;

  --header-h: 64px;
  --max: 1240px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(4.5rem, 10vw, 8rem);
}

html[data-theme="dark"] {
  --paper:    #0C1320;
  --paper-2:  #121B2C;
  --paper-3:  #1A2436;
  --ink:      #EDE6D6;
  --ink-2:    #8891A2;
  --ink-3:    #4B5464;
  --accent:   #FF6B45;
  --accent-2: #FF8C6B;
  --blue:     #6B9BD1;
  --line:     rgba(237,230,214,0.11);
  --line-2:   rgba(237,230,214,0.26);
  --grid:     rgba(107,155,209,0.05);
}

/* ── RESET ────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  padding-top: var(--header-h);
  overflow-x: hidden;
  position: relative;
  transition: background var(--dur) ease, color var(--dur) ease;
}

/* Faint drafting grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

main, header.site-header, footer.site-footer { position: relative; z-index: 1; }

h1,h2,h3,h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.mono { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.dim  { color: var(--ink-3); }
.accent { color: var(--accent); }

::selection { background: var(--accent); color: var(--paper-2); }

/* ── LAYOUT ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn--solid {
  background: var(--ink);
  color: var(--paper);
}
.btn--solid:hover {
  background: var(--accent);
  color: var(--paper-2);
  transform: translateY(-2px);
}
.btn--ghost {
  border-color: var(--line-2);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn--full { width: 100%; }

/* ── HEADER ───────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  background: var(--accent);
  color: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  transition: background var(--dur) ease, color var(--dur) ease;
}
.brand:hover .brand-mark { background: var(--accent); color: var(--paper-2); }
.brand-name { font-size: 0.95rem; letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: color var(--dur) ease, background var(--dur) ease;
}
.nav-num {
  color: var(--ink-3);
  font-size: 0.62rem;
  transition: color var(--dur) ease;
}
.nav-link:hover { color: var(--ink); background: var(--paper-3); }
.nav-link.active { color: var(--accent); }
.nav-link.active .nav-num { color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.icon-btn:hover { background: var(--paper-3); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun  { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

.menu-btn { display: none; flex-direction: column; gap: 4px; }
.menu-btn span {
  display: block; width: 18px; height: 1.5px;
  background: currentColor; border-radius: 1px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) ease;
}
.menu-btn.active span:nth-child(1) { transform: translateY(2.75px) rotate(45deg); }
.menu-btn.active span:nth-child(2) { transform: translateY(-2.75px) rotate(-45deg); }

.scroll-progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px; width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.12s linear;
}

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--section-y) 0;
}

.regmark {
  position: absolute;
  width: 18px; height: 18px;
  pointer-events: none;
  color: var(--line-2);
}
.regmark::before, .regmark::after {
  content: ''; position: absolute; background: currentColor;
}
.regmark::before { width: 100%; height: 1px; top: 50%; }
.regmark::after  { width: 1px; height: 100%; left: 50%; }
.regmark--tl { top: 1.5rem; left: 1.5rem; }
.regmark--tr { top: 1.5rem; right: 1.5rem; }
.regmark--bl { bottom: 1.5rem; left: 1.5rem; }
.regmark--br { bottom: 1.5rem; right: 1.5rem; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.hero-copy { max-width: 560px; }

.sheet-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}
.sheet-tag .divider { color: var(--accent); }

.hero-name {
  font-size: clamp(3.4rem, 8.5vw, 6.6rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 1.25rem;
}
.hero-name .line { display: block; }
.hero-name .accent { color: var(--accent); }

.hero-role {
  color: var(--ink-2);
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}
.hero-role .dim { margin: 0 0.35rem; }

.hero-lede {
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  color: var(--ink-2);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.5rem; }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  max-width: 520px;
}
.hero-facts dt { color: var(--ink-3); font-size: 0.62rem; margin-bottom: 0.3rem; }
.hero-facts dd { margin: 0; color: var(--ink); font-size: 0.72rem; letter-spacing: 0.03em; }

/* ── SCROLL CUE ───────────────────────────────────────────── */
.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-3);
  transition: color var(--dur) ease;
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(4px); }
}

/* ── SECTIONS ─────────────────────────────────────────────── */
.section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--line);
}
.section--alt { background: var(--paper-2); }

.section-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
}

.section-marker {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-self: start;
  padding-top: 0.5rem;
  border-left: 1px solid var(--line-2);
  padding-left: 1rem;
  color: var(--ink-3);
}
.section-marker .mono:first-child { color: var(--accent); font-weight: 700; }

.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 680px; }
.section-head--wide { max-width: 760px; margin-left: auto; margin-right: auto; text-align: center; }
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
}
.section-sub {
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 600px;
}
.section-head--wide .section-sub { margin-left: auto; margin-right: auto; }

/* ── PROSE ────────────────────────────────────────────────── */
.prose { max-width: 640px; }
.prose p { color: var(--ink-2); font-size: 1.02rem; line-height: 1.75; margin-bottom: 1.1rem; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ── TIMELINE ─────────────────────────────────────────────── */
.timeline {
  position: relative;
  max-width: 820px;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--line-2);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 1.4s var(--ease);
}
.timeline.is-visible::before { transform: scaleY(1); }

.tl-item { position: relative; padding-bottom: 2.6rem; }
.tl-item:last-child { padding-bottom: 0; }

.tl-marker {
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 13px; height: 13px;
  display: grid; place-items: center;
}
.tl-marker span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--accent);
  transition: background var(--dur) ease;
}
.tl-item:hover .tl-marker span { background: var(--accent); }

.tl-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  color: var(--ink-3);
  font-size: 0.68rem;
}
.tl-date { color: var(--accent); }

.tl-role {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.tl-org {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 0.85rem;
}
.tl-list li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.45rem;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.65;
}
.tl-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65em;
  width: 6px; height: 1px;
  background: var(--accent);
}

/* ── SPEC (skills) ────────────────────────────────────────── */
.spec {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 900px;
}
.spec-group {
  display: block;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  color: var(--accent);
  border-bottom: 1px solid var(--line-2);
  font-size: 0.72rem;
}
.spec-rows { display: flex; flex-direction: column; }
.spec-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur) ease, padding-left var(--dur) var(--ease);
  cursor: default;
}
.spec-row:hover {
  background: var(--paper-3);
  padding-left: 1rem;
}
.spec-row dt {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}
.spec-row dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ── CONTACT & FORM (From Version D) ──────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-list { display: flex; flex-direction: column; gap: 1.15rem; margin-bottom: 2rem; }
.contact-list dt { color: var(--ink-3); font-size: 0.65rem; margin-bottom: 0.2rem; }
.contact-list dd { margin: 0; font-size: 1rem; font-weight: 500; }
.contact-list a { color: var(--ink); position: relative; transition: color var(--dur) ease; }
.contact-list a:hover { color: var(--accent); }

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
}
.field {
  position: relative;
  padding-top: 1.35rem;
  border-bottom: 1px solid var(--line-2);
  transition: border-color var(--dur) ease;
}
.field:focus-within { border-bottom-color: var(--accent); }
.field label {
  position: absolute;
  top: 0; left: 0;
  color: var(--ink-3);
  font-size: 0.64rem;
  pointer-events: none;
  transition: color var(--dur) ease;
}
.field:focus-within label { color: var(--accent); }
.field input,
.field textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.35rem 0 0.65rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  outline: none;
  resize: vertical;
}
.field textarea { min-height: 96px; }

.form-status {
  color: var(--accent);
  font-size: 0.7rem;
  min-height: 1.2em;
  text-align: center;
  margin: 0;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  background: var(--paper-2);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-2);
  font-size: 0.7rem;
}
.footer-meta { display: flex; gap: 0.6rem; }

@media (max-width: 960px) {
  .section-grid { grid-template-columns: 1fr; }
  .section-marker { position: static; flex-direction: row; border-left: none; border-top: 1px solid var(--line-2); padding: 0.5rem 0 0; }
}

@media (max-width: 720px) {
  :root { --header-h: 58px; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1rem var(--pad) 1.5rem;
    gap: 0.25rem;
    transform: translateY(-120%);
    transition: transform var(--dur) var(--ease);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }
  .nav.is-open { transform: translateY(0); }
  .nav-link { padding: 0.7rem 0.5rem; font-size: 1rem; }
  .menu-btn { display: flex; }
}