@import "/css/fonts.css";

:root {
  /* Color */
  --bg: #F9F6F3;
  --surface: #FFFDFA;
  --ink: #221E27;
  --muted: #6B6370;
  --plum: #8A3E63;
  --plum-hover: #73314F;
  --plum-tint: #F3E9EE;
  --teal: #4C6B66;
  --teal-hover: #3D5752;
  --teal-tint: #E9EFED;
  --line: #ECE7E1;

  /* Type */
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --maxw: 1080px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7rem);
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Animated diagonal line background (see js/background.js) — sits behind all content */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.content { position: relative; z-index: 1; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 1.8rem + 3.5vw, 4rem); }
h2 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); }
h3 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem); }

p { margin: 0 0 1rem; }
em { font-style: italic; color: var(--plum); }

a { color: var(--plum); text-decoration: none; }
a:hover { color: var(--plum-hover); }

:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Utilities */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.eyebrow { display: inline-block; margin-bottom: 1rem; }
.section { padding-block: var(--section-y); position: relative; }
/* section dividers removed — the diagonal background is the only line language now */
.section-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--teal);
  letter-spacing: 0.12em;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
  padding: 0.7em 1.2em; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn-primary { background: var(--plum); color: #fff; }
.btn-primary:hover { background: var(--plum-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--plum); color: var(--plum); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.tag {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--teal); background: var(--teal-tint);
  padding: 0.25em 0.6em; border-radius: 5px;
}

/* Scroll-reveal (progressive enhancement; JS adds .is-visible) */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: transparent;
  backdrop-filter: none;
  transition: background 0.25s ease, backdrop-filter 0.25s ease;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; }
.brand { font-family: var(--font-sans); font-weight: 600; font-size: 1.35rem; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { color: var(--muted); font-size: 0.92rem; position: relative; }
.site-nav a:hover, .site-nav a.is-active { color: var(--ink); }
.site-nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--plum);
}
@media (max-width: 640px) {
  .site-nav { gap: 0.85rem; font-size: 0.85rem; }
  .header-inner { flex-direction: column; gap: 0.6rem; align-items: flex-start; }
}

/* Footer */
.site-footer { padding-block: 2.5rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-social { display: flex; gap: 1rem; }
.footer-social a { color: var(--teal); font-size: 0.9rem; }
.footer-social a:hover { color: var(--teal-hover); }

/* Skip link (visible only on keyboard focus) */
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem;
  background: var(--plum); color: #fff;
  padding: 0.5rem 0.9rem; border-radius: 6px; z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; color: #fff; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center; padding-block: clamp(3rem, 8vw, 6rem);
}
.hero h1 { margin-top: 0.25rem; }
.hero h1 em { white-space: nowrap; }  /* keep "full-stack" from breaking across lines */
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.75rem 0 1.25rem; }
.hero-meta { color: var(--teal); }

/* Hero portrait */
.hero-visual { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--plum-tint); }
.hero-photo { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { aspect-ratio: 16 / 9; order: -1; }
  /* Let the headline wrap naturally on mobile instead of the desktop break. */
  .hero-copy h1 br { display: none; }
  /* Wide crop on mobile cuts the head off when centered — bias toward the top. */
  .hero-photo { object-position: center 12%; }
}

/* Work list — borderless cards, separated by spacing + a soft hover fill */
.work-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0.5rem; }
.work-link {
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
  padding: 1.6rem 1.4rem; color: var(--ink);
  border-radius: var(--radius); transition: background 0.18s ease, color 0.18s ease;
}
.work-link:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.work-link:hover h3 { color: var(--plum); }
.work-main h3 { margin: 0 0 0.4rem; transition: color 0.18s ease; }
.work-main p { color: var(--muted); margin: 0 0 0.85rem; max-width: 60ch; }
.work-cta { color: var(--plum); white-space: nowrap; }
.work-arrow { display: inline-block; transition: transform 0.2s ease; }
.work-link:hover .work-arrow { transform: translateX(4px); }
@media (max-width: 640px) {
  .work-link { grid-template-columns: 1fr; gap: 0.75rem; align-items: start; }
}

/* Case study page */
.case { padding-block: clamp(2.5rem, 6vw, 4.5rem); max-width: 760px; }
.back-link { display: inline-block; margin-bottom: 2rem; color: var(--teal); }
.case-head h1 { margin: 0.5rem 0 0.75rem; }
.case-body { margin-top: 2.5rem; }
.case-body h2 { font-size: 1.6rem; margin-top: 2rem; }
.case-outcome { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--plum); }

/* About */
.about-copy { max-width: 60ch; margin-top: 1.5rem; }
.about-copy p { font-size: 1.1rem; }

/* Skills */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem; margin-top: 2rem;
}
.skill-group .mono { display: block; margin-bottom: 0.85rem; color: var(--teal); }

/* Contact */
.contact-form { max-width: 520px; margin-top: 2rem; display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.field input, .field textarea {
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.7em 0.8em; width: 100%;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--plum); outline-offset: 1px; border-color: var(--plum); }
.contact-form button { justify-self: start; margin-top: 0.25rem; }
.hidden-field { display: none; }

/* Resume */
.resume { max-width: 1000px; }
.resume-head { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.resume h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 2rem + 3vw, 4.25rem);
  letter-spacing: 0;
  line-height: 1.0;
  margin: 0;
}
.resume .lead { margin-top: 0.75rem; }
.resume-h {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.5rem; margin-top: 3rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--line);
}
.resume-h::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--plum); flex: none; }
.timeline { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.timeline-item { display: grid; grid-template-columns: max-content 1fr; gap: 2rem; padding: 1.75rem 0; border-top: 1px solid var(--line); }
.timeline-item:first-child { border-top: none; }
.timeline-item h3 { margin: 0 0 0.15rem; font-size: 1.3rem; }
.timeline-item h3 .org { color: var(--plum); }
.job-period { padding-top: 0.4rem; white-space: nowrap; }
.job-loc { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 0.85rem; }
.job-points { list-style: none; padding: 0; margin: 0; }
.job-points li { position: relative; padding-left: 1.25rem; margin-bottom: 0.55rem; color: var(--muted); line-height: 1.6; }
.job-points li:last-child { margin-bottom: 0; }
.job-points li::before { content: "–"; position: absolute; left: 0; color: var(--teal); font-weight: 600; }
@media (max-width: 560px) { .timeline-item { grid-template-columns: 1fr; gap: 0.5rem; } .job-period { padding-top: 0; } }

/* Activity / GitHub contributions */
.activity-stats { color: var(--teal); margin-top: 1rem; }
.cal-scroll { overflow-x: auto; margin: 1.5rem 0 1rem; padding-bottom: 0.5rem; }
.cal {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  grid-auto-columns: 11px;
  gap: 3px;
  width: max-content;
}
.cal-day { width: 11px; height: 11px; border-radius: 2px; background: #E8E2DA; }
.cal-day.lvl-1 { background: #E4C4D2; }
.cal-day.lvl-2 { background: #C98BA8; }
.cal-day.lvl-3 { background: #A85F82; }
.cal-day.lvl-4 { background: #8A3E63; }
.cal-legend { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.cal-legend .sw { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.cal-legend .sw.lvl-0 { background: #E8E2DA; }
.cal-legend .sw.lvl-1 { background: #E4C4D2; }
.cal-legend .sw.lvl-2 { background: #C98BA8; }
.cal-legend .sw.lvl-3 { background: #A85F82; }
.cal-legend .sw.lvl-4 { background: #8A3E63; }
.activity-link { margin-top: 1.25rem; }

/* Print — clean, branded resume export (/resume/ → Save as PDF) */
@media print {
  @page { margin: 0.6in; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-header, .site-footer, .skip-link, .resume .btn, #bg-canvas { display: none !important; }
  body { background: #fff; }
  .section { padding-block: 0 !important; }
  .resume { max-width: none; padding-inline: 0; }
  .resume-head { margin-top: 0; }
  .resume .lead { margin-top: 0.4rem; }
  .resume-h { margin-top: 1.5rem; break-after: avoid; }
  .timeline-item { break-inside: avoid; padding: 0.7rem 0; }
  .job-points li { color: #2b2b2b; }
  a { color: inherit; text-decoration: none; }
}

/* Job-scan page (/job-scan/ — noindexed, local) */
.job-note { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.02em; color: var(--muted); margin: 0.25rem 0 0; }
.job-list { list-style: none; padding: 0; margin: 1rem 0 2.25rem; display: grid; gap: 0.6rem; }
.job { padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 55%, transparent); transition: border-color 0.18s ease; }
.job:hover { border-color: color-mix(in srgb, var(--plum) 40%, var(--line)); }
.job-title { display: block; font-weight: 600; color: var(--ink); line-height: 1.4; }
.job-title:hover { color: var(--plum); }
.job-meta { display: block; margin-top: 0.4rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.02em; color: var(--muted); }
.job-src { color: var(--teal); }
.job-status { margin-top: 1.5rem; color: var(--muted); }
.job-status summary { cursor: pointer; font-family: var(--font-mono); font-size: 0.8rem; color: var(--teal); }
.job-status li { font-size: 0.85rem; }

/* Local-only workspace dock — only rendered on local dev builds (see base.njk). */
.dev-dock { position: fixed; left: 1rem; bottom: 1rem; z-index: 9999; display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; max-width: calc(100vw - 2rem); padding: 0.5rem 0.75rem; background: var(--ink); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.38); font-size: 0.72rem; opacity: 0.55; transition: opacity 0.18s ease; }
.dev-dock:hover { opacity: 1; }
.dev-dock a { color: #fff; opacity: 0.85; text-decoration: none; }
.dev-dock a:hover { color: var(--plum-tint); opacity: 1; text-decoration: underline; }
.dev-dock-label { color: var(--plum-tint); text-transform: uppercase; letter-spacing: 0.1em; padding-right: 0.4rem; border-right: 1px solid rgba(255, 255, 255, 0.22); }
