/* ==========================================================================
   Geordan Gesink — Portfolio
   Hand-written, dependency-free. Editorial-minimal theme, light & dark.
   Theme: follows the system by default; [data-theme] on <html> overrides.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --ink: #191918;
  --ink-soft: #3D3C3A;
  --muted: #6E6C67;
  --line: #E7E5DF;
  --line-strong: #D4D1C9;
  --accent: #C7502F;
  --accent-hover: #A63E20;
  --nav-bg: rgba(250, 250, 247, 0.82);
  --shadow-color: rgba(25, 25, 24, 0.18);
  --focus-ring: rgba(25, 25, 24, 0.08);
  --placeholder: #6E6C67;
  --radius: 18px;
  --maxw: 1080px;
  --nav-h: 68px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* Dark tokens — keep the two blocks below identical.
   1) System prefers dark and no manual light override. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141311;
    --surface: #1D1C19;
    --ink: #F1EFE9;
    --ink-soft: #C7C4BC;
    --muted: #949188;
    --line: #2B2A26;
    --line-strong: #3D3B34;
    --accent: #E0693F;
    --accent-hover: #EC8760;
    --nav-bg: rgba(20, 19, 17, 0.82);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --focus-ring: rgba(241, 239, 233, 0.1);
    --placeholder: #949188;
  }
}

/* 2) Manual dark override. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141311;
  --surface: #1D1C19;
  --ink: #F1EFE9;
  --ink-soft: #C7C4BC;
  --muted: #949188;
  --line: #2B2A26;
  --line-strong: #3D3B34;
  --accent: #E0693F;
  --accent-hover: #EC8760;
  --nav-bg: rgba(20, 19, 17, 0.82);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --focus-ring: rgba(241, 239, 233, 0.1);
  --placeholder: #6E6B63;
}

/* ---------- Reset ---------- */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

::selection { background: var(--accent-hover); color: var(--bg); }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Type ---------- */

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.75rem, 7vw, 4.75rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }

.accent { color: var(--accent); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
}

.nav-mark svg { width: 20px; height: 20px; }

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--ink);
  background: var(--surface);
  color: var(--ink);
}

.theme-toggle svg { width: 17px; height: 17px; }

/* Language pill shares the toggle look but carries text */
.lang-toggle {
  width: auto;
  min-width: 36px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Show the icon for the theme a click would switch to */
.theme-toggle .icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--accent-hover); }

.nav-cta {
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink) !important;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav-cta:hover {
  border-color: var(--ink);
  background: var(--surface);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn:active { transform: scale(0.98); }

.btn-solid {
  background: var(--ink);
  color: var(--bg);
}
.btn-solid:hover { background: var(--accent-hover); }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.btn-full { width: 100%; font-family: var(--font); font-size: 1rem; }

/* ---------- Hero ---------- */

.hero {
  padding: calc(var(--nav-h) + clamp(72px, 14vh, 140px)) 0 clamp(72px, 12vh, 120px);
}

.hero-sub {
  max-width: 560px;
  margin-top: 28px;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  color: var(--ink-soft);
}

.hero-sub a {
  color: var(--ink);
  font-weight: 600;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.hero-sub a:hover { color: var(--accent-hover); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 56px;
  margin-top: clamp(56px, 9vh, 88px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.hero-meta dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.hero-meta dd { font-weight: 600; font-size: 0.9375rem; }

/* ---------- Sections ---------- */

.section { padding: clamp(80px, 12vh, 130px) 0; }

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head { margin-bottom: clamp(48px, 7vh, 72px); }

/* ---------- Work grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 40px -18px var(--shadow-color);
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card-index {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
}

.card-type {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.card h3 { font-size: 1.5rem; }

.card-link { text-decoration: none; }

/* stretch the title link over the whole card */
.card-link::after { content: ""; position: absolute; inset: 0; }

.card .arrow {
  display: inline-block;
  font-size: 1.05rem;
  color: var(--muted);
  transition: transform 0.25s ease, color 0.25s ease;
}
.card:hover .arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

.card p {
  font-size: 0.9688rem;
  color: var(--ink-soft);
  flex-grow: 1;
}

.card-wide { grid-column: 1 / -1; }
.card-wide p { max-width: 66ch; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.tags li {
  font-family: var(--mono);
  font-size: 0.71875rem;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg);
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}

.about-photo { margin: 0; }

.about-photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.about-text p { color: var(--ink-soft); }
.about-text p + p { margin-top: 20px; }

.toolbox {
  display: flex;
  flex-direction: column;
  margin-top: 44px;
  border-top: 1px solid var(--line-strong);
}

.toolbox-group {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.toolbox-group h3 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 6px;
}

.toolbox-group p { font-weight: 600; font-size: 0.9375rem; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}

.contact-sub {
  max-width: 380px;
  margin-top: 20px;
  color: var(--ink-soft);
}

.contact-email {
  display: inline-block;
  margin-top: 28px;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 5px;
  transition: color 0.2s ease;
}
.contact-email:hover { color: var(--accent-hover); }

.socials {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin-top: 24px;
}

.socials a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.socials a:hover { color: var(--accent-hover); }

/* ---------- Form ---------- */

.contact-form {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hidden-field { display: none; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font);
  font-size: 0.9688rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--placeholder); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-note { font-size: 0.8125rem; }

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--accent-hover); }

/* ---------- Reveal animation ---------- */
/* Animation-based (not transition-based) so it never overrides the cards'
   own hover transitions/transforms once the entrance finishes. */

.reveal:not(.visible) {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.visible {
  animation: reveal-in 0.6s ease backwards;
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(18px); }
}

/* must be .dN.visible: the animation shorthand above resets animation-delay */
.d1.visible { animation-delay: 0.08s; }
.d2.visible { animation-delay: 0.16s; }
.d3.visible { animation-delay: 0.24s; }
.d4.visible { animation-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal:not(.visible) { opacity: 1; transform: none; }
  .reveal.visible { animation: none; }
  .card, .card .arrow, .btn { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .contact-grid { gap: 48px; }
  .about-photo { max-width: 420px; }
}

@media (max-width: 680px) {
  .nav-name { display: none; }
  .nav-links { gap: 18px; }
}

@media (max-width: 620px) {
  .nav-inner { padding: 0 16px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 0.875rem; }
  .nav-cta { padding: 7px 11px; }
  .theme-toggle { width: 32px; height: 32px; }
  .card { padding: 26px 22px; }
  .contact-form { padding: 26px 22px; }
  .form-row { grid-template-columns: 1fr; }
  .hero-meta { gap: 16px 36px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
