/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Marck Script";
  src: url("/assets/fonts/marck-script-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Design tokens (captured from the reference site) ---------- */
:root {
  --color-header: #080c1c;
  --color-work-bg: #080c1c;
  --color-hero-bg: #535665;
  --color-card-head: #000;
  --color-viewer-bg: #000;
  --color-accent: #4682b4;      /* logo, "Work" heading, active nav */
  --color-accent-light: #8db8de; /* accent for small text on dark (AA contrast) */
  --color-accent-strong: #2f5f8a; /* button background behind white text (AA contrast) */
  --color-text-light: #fff;
  --color-text-muted: #c7c7c7;
  --color-contact-bg: #fff;
  --color-contact-text: #111;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-card: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-logo: "Marck Script", cursive;

  --container: 1100px;
  --gutter: 16px;
  --header-h: 72px;
  --radius: 4px;
}
@media (min-width: 768px) {
  :root { --header-h: 104px; --gutter: 24px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-light);
  background: var(--color-work-bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: #fff; color: #000; padding: 10px 14px; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 8px; }
main:focus { outline: none; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-header);
  height: var(--header-h);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: var(--font-logo); font-size: 32px; color: var(--color-accent);
  text-decoration: none; line-height: 1; padding: 6px 0;
}
.site-nav { display: flex; gap: 56px; }
.site-nav a {
  font-weight: 700; font-size: 16px; text-decoration: none; color: var(--color-text-light);
  display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--color-accent-light); }
.nav-toggle { display: none; }

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer;
  }
  .nav-toggle-bar { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--color-header);
    border-top: 1px solid #1d2440; display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { justify-content: flex-start; padding: 12px var(--gutter); border-bottom: 1px solid #1d2440; }
}

/* ---------- Hero ---------- */
.hero { background: var(--color-hero-bg); overflow: hidden; }
.hero-inner {
  display: grid; grid-template-columns: 1fr; align-items: center; gap: 16px;
  padding-top: 40px;
}
.hero-hey { display: block; font-size: clamp(30px, 6vw, 50px); font-weight: 700; color: var(--color-text-muted); }
.hero-name {
  font-size: clamp(52px, 12vw, 100px); font-weight: 800; letter-spacing: -0.01em;
  line-height: 1.12; margin-top: 8px;
}
.hero-name span { display: block; }
.hero-tagline {
  display: inline-block; margin-top: 20px; padding: 10px 14px;
  border: 2px solid #fff; font-size: 17px; font-weight: 600;
}
.hero-art { justify-self: center; width: min(78vw, 420px); }
.hero-art img { width: 100%; height: auto; }
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; padding-top: 72px; min-height: 600px; }
  .hero-art { justify-self: end; align-self: end; width: 100%; max-width: 470px; }
  .hero-text { padding-bottom: 72px; }
}

/* ---------- Work (Home cards) ---------- */
.work { background: var(--color-work-bg); padding: 48px 0 64px; }
.section-title {
  text-align: center; color: var(--color-accent); font-size: 40px; font-weight: 700;
  font-family: var(--font-card); margin-bottom: 24px;
}
.card-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 32px; grid-template-columns: 1fr;
  max-width: 600px; margin: 0 auto; /* one case study after another, like the reference */
}

.card {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: var(--color-text-light); background: var(--color-card-head);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.card-head { padding: 22px 18px; text-align: center; font-family: var(--font-card); }
.card-category { display: block; font-size: clamp(22px, 4vw, 28px); font-weight: 700; }
.card-title { display: block; margin-top: 6px; font-size: clamp(17px, 3vw, 22px); }
.card-media { position: relative; aspect-ratio: 1 / 1; background: #111; margin-top: auto; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-arrow {
  position: absolute; right: 14px; bottom: 14px; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #222; background: rgba(255,255,255,.85); color: #111;
  display: grid; place-items: center; font-size: 18px; line-height: 1;
}

/* ---------- Work page (stacked PDFs) ---------- */
.work-page { padding: 32px 0 64px; background: var(--color-viewer-bg); }
.work-page .section-title { margin-bottom: 8px; }
.work-intro { text-align: center; color: var(--color-text-muted); margin: 0 0 16px; }
.jump-menu {
  position: sticky; top: var(--header-h); z-index: 40; background: rgba(0,0,0,.92);
  border-bottom: 1px solid #222; backdrop-filter: blur(6px);
}
.jump-menu ul {
  list-style: none; margin: 0 auto; padding: 8px var(--gutter); max-width: var(--container);
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.jump-menu ul::-webkit-scrollbar { display: none; }
.jump-menu a {
  display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap;
  padding: 0 14px; border: 1px solid #333; border-radius: 999px; text-decoration: none; font-size: 14px;
}
.jump-menu a:hover, .jump-menu a.is-active { border-color: var(--color-accent-light); color: var(--color-accent-light); }

.case-study { padding: 40px 0 8px; }
.case-study + .case-study { border-top: 1px solid #1a1a1a; }
.case-head { max-width: 940px; margin: 0 auto 16px; }
.case-category { color: var(--color-accent-light); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.case-title { font-size: clamp(24px, 4vw, 32px); font-weight: 800; margin-top: 4px; }
.case-desc { color: var(--color-text-muted); margin: 6px 0 0; }
.case-summary { margin: 10px 0 0; font-size: 15px; color: #e6e6e6; }

/* PDF viewer */
.pdf-viewer {
  max-width: 940px; margin: 0 auto; background: #202124; border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.pdf-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 6px 8px; background: #2b2c30; border-bottom: 1px solid #3a3b40;
}
.pdf-pageinfo { margin-right: auto; font-size: 14px; color: #ddd; padding: 0 8px; font-variant-numeric: tabular-nums; }
.pdf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--radius);
  background: transparent; color: #fff; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none;
}
.pdf-btn:hover { background: #3a3b40; }
.pdf-btn svg { width: 20px; height: 20px; }
.pdf-btn .label { display: none; }
@media (min-width: 600px) { .pdf-btn .label { display: inline; } }

.pdf-pages {
  height: 75vh; height: 75svh; overflow-y: auto; overscroll-behavior-y: auto; /* at the first/last page, keep scrolling the page */
  padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom;
}
@media (min-width: 768px) { .pdf-pages { height: 790px; padding: 24px; } }
.pdf-page { width: 100%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); position: relative; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-status { color: #ccc; text-align: center; padding: 40px 16px; }
.pdf-fallback a { color: #fff; }
.pdf-open-direct {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; margin-top: 12px;
  background: var(--color-accent-strong); color: #fff; border-radius: var(--radius); text-decoration: none; font-weight: 600;
}
.pdf-viewer.is-fullscreen { position: fixed; inset: 0; z-index: 200; max-width: none; border-radius: 0; }
.pdf-viewer.is-fullscreen .pdf-pages, .pdf-viewer:fullscreen .pdf-pages { height: auto; flex: 1; }
.pdf-viewer:fullscreen { max-width: none; width: 100%; height: 100%; }
body.has-fullscreen { overflow: hidden; }

/* ---------- Contact ---------- */
.contact { background: var(--color-contact-bg); color: var(--color-contact-text); padding: 48px 0; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 28px; text-align: center; max-width: 720px; }
@media (min-width: 640px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-item h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.contact-item a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; text-decoration: none; font-size: 15px; }
.contact-item a:hover { text-decoration: underline; }
.linkedin { color: #000; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #111; color: #fff; padding: 10px 16px; border-radius: var(--radius);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 300;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Misc ---------- */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--color-accent-strong); color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.notfound { padding: 96px 0; text-align: center; min-height: 50vh; }
.notfound h1 { font-size: 40px; margin-bottom: 12px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; margin: 6px;
  background: var(--color-accent-strong); color: #fff; border-radius: var(--radius); text-decoration: none; font-weight: 600;
}
