/* ---------------------------------------------------------------
   Gurpreet Singh Panesar — Portfolio
   Design: engineering drafting sheet. Grid-paper ground, numbered
   sheets, copper-trace accent (nod to PCB/CAD background).
   Fonts: Big Shoulders Display (display), IBM Plex Sans (body),
   IBM Plex Mono (labels / meta / data).
--------------------------------------------------------------- */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Tokens: light (default) ---------- */
:root {
  --bg: #F3F5F6;
  --surface: #FFFFFF;
  --surface-2: #E9EDEF;
  --border: #D7DEE1;
  --text: #12181C;
  --text-dim: #55636A;
  --text-faint: #85949B;
  --accent: #A85D1C;
  --accent-soft: #F1E1CD;
  --accent-ink: #FFFFFF;
  --grid-line: rgba(18, 24, 28, 0.06);
  --shadow: rgba(18, 24, 28, 0.10);

  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --rail-w: 260px;
  --content-max: 760px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10161A;
    --surface: #161D22;
    --surface-2: #1E272D;
    --border: #2A343B;
    --text: #EAF0F2;
    --text-dim: #93A5AC;
    --text-faint: #62727A;
    --accent: #E0954B;
    --accent-soft: #3A2A1B;
    --accent-ink: #14100B;
    --grid-line: rgba(234, 240, 242, 0.07);
    --shadow: rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  --bg: #10161A;
  --surface: #161D22;
  --surface-2: #1E272D;
  --border: #2A343B;
  --text: #EAF0F2;
  --text-dim: #93A5AC;
  --text-faint: #62727A;
  --accent: #E0954B;
  --accent-soft: #3A2A1B;
  --accent-ink: #14100B;
  --grid-line: rgba(234, 240, 242, 0.07);
  --shadow: rgba(0, 0, 0, 0.45);
}

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.page {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100vh;
}

/* ---------- Rail nav ---------- */
.railnav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 28px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.rail-brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid var(--accent);
  color: var(--accent);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

.rail-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 48px;
}

.rail-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 8px;
  font-size: 14px;
  color: var(--text-dim);
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.rail-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.rail-link:hover { color: var(--text); }

.rail-link.active {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--surface-2);
}

.rail-link.active .rail-num { color: var(--accent); }

.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.rail-cta {
  color: var(--accent);
  font-weight: 500;
}

.rail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---------- Mobile top bar ---------- */
.mobile-topbar { display: none; }

/* ---------- Content ---------- */
.content { padding: 0 48px 0 56px; }

section { padding: 96px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

.eyebrow,
.section-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; }

/* ---------- Hero ---------- */
.hero { padding-top: 56px; max-width: var(--content-max); }

.hero .eyebrow { margin-bottom: 18px; }

.hero h1 {
  font-size: clamp(42px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: 0.005em;
  margin-bottom: 26px;
}

.hero-lede {
  max-width: 62ch;
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.hero-meta a { color: var(--text); border-bottom: 1px solid var(--border); }
.hero-meta a:hover { border-color: var(--accent); color: var(--accent); }
.hero-meta span { color: var(--text-faint); }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  max-width: 22ch;
}

/* ---------- Systems ---------- */
.systems h2, .approach h2, .background h2, .contact h2 {
  font-size: clamp(28px, 3.4vw, 38px);
  margin: 10px 0 16px;
  max-width: 20ch;
}

.section-intro {
  max-width: 62ch;
  color: var(--text-dim);
  margin-bottom: 56px;
}

.sheet {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 40px clamp(20px, 4vw, 48px);
  margin-bottom: 40px;
}

.sheet::before,
.sheet::after,
.sheet-head::before,
.sheet-head::after { content: none; }

/* corner tick marks */
.sheet {
  --tick: 14px;
}
.sheet::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: var(--tick); height: var(--tick);
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}
.sheet::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: var(--tick); height: var(--tick);
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.sheet-head {
  display: flex;
  gap: 20px;
  align-items: baseline;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.sheet-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: var(--accent-soft);
  -webkit-text-stroke: 1px var(--accent);
  line-height: 1;
  flex: none;
}

.sheet-head h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.sheet-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.sheet-block { margin-bottom: 26px; }

.sheet-block h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 10px;
}

.sheet-block p { color: var(--text-dim); max-width: 66ch; }
.sheet-block p + p { margin-top: 12px; }

.sheet-block ul { display: flex; flex-direction: column; gap: 10px; max-width: 66ch; }

.sheet-block li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
}

.sheet-block li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.sheet-block li strong { color: var(--text); font-weight: 600; }

/* flow diagram */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 30px 0;
  padding: 22px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
}

.flow-node {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.flow-arrow { color: var(--accent); font-weight: 600; flex: none; }

/* exhibit: real product screenshots */
.exhibit {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 30px 0;
}

.exhibit-item {
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.exhibit-item img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid var(--border);
}

.exhibit-item figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 12px 14px;
  line-height: 1.5;
}

.sheet-result {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.result-tag {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 4px 9px;
  margin-top: 2px;
}

.sheet-result p { color: var(--text); font-weight: 500; }

/* ---------- Approach ---------- */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 8px;
}

.approach-card {
  background: var(--surface);
  padding: 28px 26px;
}

.approach-card h3 {
  font-size: 15px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 12px;
}

.approach-card p { color: var(--text-dim); font-size: 14.5px; }

/* ---------- Background / skills ---------- */
.skill-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
  margin: 8px 0 40px;
}

.skill-group h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--surface);
}

.prior-role {
  max-width: 68ch;
  color: var(--text-dim);
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.prior-role strong { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact p { color: var(--text-dim); max-width: 60ch; margin-bottom: 32px; }

.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn-primary,
.btn-secondary {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 14px 22px;
  border: 1px solid var(--accent);
}

.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { opacity: 0.9; }

.btn-secondary { color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.page-footer {
  padding: 32px 0 64px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .page { grid-template-columns: 1fr; }

  .railnav { display: none; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 16px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .mobile-topbar .rail-brand { transform: scale(0.9); transform-origin: left center; }

  .mobile-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 12px;
  }

  .mobile-nav a {
    padding: 8px 10px;
    color: var(--text-dim);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }

  .mobile-nav a.active { color: var(--accent); border-color: var(--accent); }

  .content { padding: 0 20px; }

  .stat-strip { grid-template-columns: 1fr; gap: 20px; }

  .approach-grid { grid-template-columns: 1fr; }

  .skill-groups { grid-template-columns: 1fr; }

  section { padding: 64px 0; }
}

@media (max-width: 560px) {
  .hero-meta { flex-direction: column; gap: 12px; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow-arrow { text-align: center; }
  .page-footer { flex-direction: column; gap: 6px; }
}
