/* =========================================================================
   Ebru Subutay — Portfolio
   Theme: MINIMAL / ELEGANT — monochrome with a single burnt-orange accent.
   Inspired by kentokawazoe.com: persistent left nav rail, oversized thin
   uppercase display type, engineering-mono micro-labels, dark/light toggle.
   Pure vanilla CSS. No build. Dark is the default.
   ========================================================================= */

/* ---- Design tokens — DARK (default) ----------------------------------- */
:root {
  /* monochrome surfaces */
  --bg:        #0a0a0a;
  --bg-1:      #121212;   /* cards / panels */
  --bg-2:      #1a1a1a;   /* media wells / hover / code */

  /* greyscale text */
  --fg:        #EDEDED;
  --fg-dim:    #A6A6A6;
  --fg-faint:  #7d7d7d;

  /* hairlines */
  --hair:      rgba(255, 255, 255, 0.12);
  --hair-2:    rgba(255, 255, 255, 0.22);

  /* the ONE accent — her burnt orange (same hex in both themes) */
  --accent:    #C2410C;   /* fills, underlines, marks */
  --accent-2:  #E0651F;   /* bright / hover */
  --accent-ink:#E0651F;   /* accent used as TEXT (AA on dark) */
  --on-accent: #FFFFFF;   /* text on a solid accent fill */

  --font-display: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
                  Helvetica, Arial, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, "SFMono-Regular", Menlo,
                  Consolas, monospace;

  --maxw: 1080px;
  --rail-w: 232px;
  --bar-h: 60px;
  --radius: 12px;
  --radius-sm: 9px;
  --radius-lg: 16px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);

  /* Hero-veil scrim base — the page bg as raw RGB so the scrim can fade to a
     transparent version of the SAME hue (no grey mid-gradient artifact). */
  --veil-bg: 10, 10, 10;

  color-scheme: dark;
}

/* ---- Design tokens — LIGHT --------------------------------------------- */
:root[data-theme="light"] {
  --bg:        #F7F5F2;   /* warm white */
  --bg-1:      #FFFFFF;
  --bg-2:      #EDE9E3;

  --fg:        #1A1A1A;
  --fg-dim:    #55514C;
  --fg-faint:  #6b6660;

  --hair:      rgba(0, 0, 0, 0.12);
  --hair-2:    rgba(0, 0, 0, 0.24);

  --accent:    #C2410C;
  --accent-2:  #E0651F;
  --accent-ink:#C2410C;   /* accent as TEXT (AA on warm white) */
  --on-accent: #FFFFFF;

  --veil-bg: 247, 245, 242;   /* warm white, for the hero-veil scrim */

  color-scheme: light;
}

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

* { margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-left: var(--rail-w);
  transition: background .25s ease, color .25s ease;
}

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

a {
  color: var(--accent-ink);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  z-index: 10000;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: var(--rail-w); }

/* ---- Layout helpers --------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3.5rem);
}

.section {
  padding-block: clamp(3rem, 8vw, 6rem);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--fg);
}

h2.heading {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
  margin-bottom: 0.9rem;
}

/* Mono eyebrow / micro-label — the engineering signal. */
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--accent-ink);
  margin-bottom: 0.8rem;
}

.section-sub {
  color: var(--fg-dim);
  max-width: 62ch;
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.lead { color: var(--fg-dim); max-width: 64ch; font-size: 1.1rem; }

.muted { color: var(--fg-dim); }
.faint { color: var(--fg-faint); }

/* =========================================================================
   Left nav rail  (desktop) / top bar (mobile)
   ========================================================================= */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  padding: 2.2rem 1.6rem;
  background: var(--bg);
  border-right: 1px solid var(--hair);
  z-index: 90;
}

.rail__head { display: flex; align-items: flex-start; justify-content: space-between; }

.rail__brand {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--fg);
}
.rail__brand:hover { text-decoration: none; color: var(--accent-ink); }

.rail__controls { display: flex; align-items: center; gap: 0.75rem; }

.rail__panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: 3rem;
}

.rail__nav { display: flex; flex-direction: column; gap: 1rem; }
.rail__nav a {
  position: relative;
  width: max-content;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
  color: var(--fg-dim);
  padding-bottom: 3px;
}
.rail__nav a:hover { color: var(--fg); text-decoration: none; }
.rail__nav a[aria-current="page"] { color: var(--fg); }
.rail__nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.rail__social {
  display: flex;
  gap: 1.1rem;
  margin-top: auto;
  padding-top: 2rem;
}
.rail__social a { color: var(--fg-dim); line-height: 0; }
.rail__social a:hover { color: var(--accent-ink); }
.rail__social svg { width: 20px; height: 20px; display: block; fill: currentColor; }

/* Hamburger — hidden on desktop */
.rail__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--hair-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.rail__burger span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--fg);
  transition: transform .2s ease, opacity .2s ease;
}
.rail__burger:hover { border-color: var(--accent); }

/* =========================================================================
   Theme toggle — pill switch (fixed top-right on desktop)
   ========================================================================= */
.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-1);
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
  color: var(--fg-dim);
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle__track {
  position: relative;
  width: 40px;
  height: 20px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--hair);
  flex: none;
}
.theme-toggle__thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform .22s ease;
}
/* aria-pressed=true means DARK is active → thumb left; light → thumb right */
.theme-toggle[aria-pressed="false"] .theme-toggle__thumb { transform: translateX(20px); }
.theme-toggle__icon {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1;
  color: var(--fg-dim);
}

/* =========================================================================
   Hero (home)
   ========================================================================= */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(4rem, 14vw, 10rem);
}
/* Keep the hero content above every decorative layer. */
.hero > .wrap { position: relative; z-index: 3; }

/* Layer 1 — animated ASCII / dot-matrix veil (canvas, drawn in JS).
   Per-glyph alpha is handled in script.js; the edge mask fades it out so the
   veil dissolves into the negative space rather than filling a hard rectangle. */
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(130% 125% at 30% 42%, #000 38%, transparent 92%);
          mask-image: radial-gradient(130% 125% at 30% 42%, #000 38%, transparent 92%);
}

/* Layer 2 — soft scrim so the oversized name stays crisp over the veil.
   Fades to a transparent version of the page bg (same hue) — no grey seam. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(var(--veil-bg), 0.82) 0%,
      rgba(var(--veil-bg), 0.30) 34%,
      rgba(var(--veil-bg), 0) 64%),
    linear-gradient(0deg,
      rgba(var(--veil-bg), 0.55) 0%,
      rgba(var(--veil-bg), 0) 42%);
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 200;
  text-transform: uppercase;
  font-size: clamp(3rem, 13vw, 9rem);
  line-height: 0.94;
  letter-spacing: 0.08em;
  color: var(--fg);
  margin: 0 0 1.5rem;
}
.hero__name span { display: block; }

.hero__sub {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
  color: var(--accent-ink);
  margin-bottom: 1.5rem;
}

/* Hero intro — a small round photo "window" beside the bio-as-quote. */
.hero__intro {
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  max-width: 62ch;
}

/* Circular avatar window. The styled "ES" initials sit UNDER the <img>;
   the img covers them when it loads and (via onerror) removes itself if the
   file 404s, so the placeholder shows with no flash. */
.avatar {
  position: relative;
  flex: none;
  width: clamp(72px, 9vw, 96px);
  height: clamp(72px, 9vw, 96px);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  /* inner hairline ring + a thin burnt-orange accent ring outside it */
  box-shadow:
    0 0 0 1px var(--hair),
    0 0 0 3px rgba(194, 65, 12, 0.35);
}

.avatar__ph,
.avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.avatar__ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--fg);
  /* subtle theme-aware gradient — reads as intentional in dark AND light */
  background:
    radial-gradient(120% 120% at 30% 22%, rgba(224, 101, 31, 0.24), transparent 62%),
    var(--bg-2);
}

.avatar__img {
  object-fit: cover;
}

.hero__bio {
  position: relative;
  color: var(--fg-dim);
  max-width: 58ch;
  font-size: 1.12rem;
  padding-left: 2.4rem;
}

/* Large decorative opening quote mark at the top-left of the blockquote. */
.hero__quote {
  position: absolute;
  left: 0;
  top: -0.22em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--accent-ink);
  pointer-events: none;
}

@media (max-width: 680px) {
  .hero__intro { flex-direction: column; gap: 1.1rem; }
  .hero__bio { padding-left: 1.9rem; }
}

/* =========================================================================
   Buttons — thin outline pills
   ========================================================================= */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--hair-2);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--on-accent);
}
.btn .arrow { color: currentColor; }

/* =========================================================================
   Big directional links (home)
   ========================================================================= */
.dir-links .wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.dir-link {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  width: max-content;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: clamp(2rem, 8vw, 4.5rem);
  line-height: 1.05;
  color: var(--fg);
}
.dir-link:hover { color: var(--accent-ink); text-decoration: none; }
.dir-link__arrow { color: var(--accent-ink); transition: transform .2s ease; }
.dir-link:hover .dir-link__arrow { transform: translateX(0.5rem); }

/* =========================================================================
   Skills — three columns of outline pills
   ========================================================================= */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 2.25rem;
  margin-top: 1.75rem;
}
.skills__head {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg-faint);
  margin-bottom: 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--hair);
}
.pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pill {
  font-size: 0.8rem;
  color: var(--fg-dim);
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  padding: 0.34rem 0.85rem;
  transition: border-color .15s ease, color .15s ease;
}
/* subtle every-3rd accent emphasis (outline only — stays minimal) */
.pill:nth-child(3n) { border-color: var(--accent); color: var(--accent-ink); }

/* =========================================================================
   Cards / grids
   ========================================================================= */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.card {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--hair-2); transform: translateY(-3px); }
a.card { color: inherit; }
a.card:hover { text-decoration: none; }
a.card:hover .card__title { color: var(--accent-ink); }

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
}
.card__media img,
.card__media .card__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; flex: 1; }

.card__date {
  align-self: flex-start;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--fg-faint);
}
.card__title { font-size: 1.2rem; font-weight: 400; letter-spacing: 0.01em; transition: color .18s ease; }
.card__blurb { color: var(--fg-dim); font-size: 0.98rem; }

/* Typographic placeholder for projects without a real image yet. */
.card__media--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 1px 1px, var(--hair) 1px, transparent 0) 0 0 / 18px 18px,
    var(--bg-2);
}
.card__media--placeholder .ph-label {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
}
.card__media--placeholder .ph-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.94rem;
  color: var(--fg-dim);
}
.bullets li { padding-left: 1.4rem; position: relative; }
.bullets li::before {
  content: "\2192";           /* small arrow mark — accent */
  position: absolute;
  left: 0;
  color: var(--accent-ink);
}

.card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

/* =========================================================================
   Tag pills — mono micro-labels, subtle every-3rd accent
   ========================================================================= */
.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--fg-dim);
  background: transparent;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  padding: 0.24rem 0.65rem;
  transition: border-color .15s ease, color .15s ease;
}
.tag-pill:nth-child(3n) { border-color: var(--accent); color: var(--accent-ink); }
.tag-pill[aria-disabled="true"] {
  border-style: dashed;
  border-color: var(--hair);
  color: var(--fg-faint);
  font-style: italic;
}

/* =========================================================================
   Project sections (projects.html)
   ========================================================================= */
.proj-section + .proj-section { margin-top: clamp(2.75rem, 6vw, 4.5rem); }

/* Section B (web apps) — softer, secondary panel. */
.proj-section--apps {
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.proj-section--apps .grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 480px)); }
.proj-section--apps .card { background: var(--bg-2); }

.section-head { margin-bottom: 1.75rem; }
.section-head .heading { margin-bottom: 0.5rem; }
.section-head .section-sub { margin-bottom: 0; }
.proj-section--apps .section-head .heading { font-size: clamp(1.4rem, 3vw, 2rem); }

/* =========================================================================
   Blog list
   ========================================================================= */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post-card {
  display: block;
  border-top: 1px solid var(--hair);
  padding: 1.75rem 0.25rem;
  color: inherit;
  transition: border-color .18s ease;
}
.post-list .post-card:last-child { border-bottom: 1px solid var(--hair); }
.post-card:hover { text-decoration: none; border-color: var(--accent); }
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--fg-faint);
  margin-bottom: 0.7rem;
}
.post-card__title { font-size: 1.35rem; font-weight: 400; color: var(--fg); margin-bottom: 0.4rem; letter-spacing: 0.01em; transition: color .18s ease; }
.post-card:hover .post-card__title { color: var(--accent-ink); }
.post-card__excerpt { color: var(--fg-dim); font-size: 0.97rem; max-width: 68ch; }

/* =========================================================================
   Article (post-sample)
   ========================================================================= */
.article { max-width: 72ch; margin-inline: auto; }
.article__title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 300;
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
}
.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  font-size: 0.72rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hair);
}

.prose > * + * { margin-top: 1.2rem; }
.prose h2 { font-size: 1.55rem; font-weight: 400; margin-top: 2.5rem; color: var(--fg); }
.prose h3 { font-size: 1.25rem; font-weight: 400; margin-top: 1.75rem; color: var(--fg); }
.prose p { color: var(--fg-dim); }
.prose ul { color: var(--fg-dim); padding-left: 1.3rem; }
.prose li + li { margin-top: 0.4rem; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose code {
  font-family: var(--font-mono);
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85em;
  color: var(--accent-ink);
}
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.25rem;
  color: var(--fg);
  font-style: italic;
}

pre {
  font-family: var(--font-mono);
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}
pre code { font-family: var(--font-mono); background: none; border: none; padding: 0; color: inherit; }
.code-head {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  background: var(--bg-2);
  border: 1px solid var(--hair);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.5rem 1rem;
}
.code-head + pre { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* monochrome + one accent syntax tint */
.tk-kw  { color: var(--accent-ink); }
.tk-fn  { color: var(--fg); }
.tk-str { color: var(--fg-dim); }
.tk-num { color: var(--fg-dim); }
.tk-cm  { color: var(--fg-faint); font-style: italic; }

/* =========================================================================
   Photography gallery + lightbox
   ========================================================================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.photo {
  position: relative;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-1);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .2s ease;
}
.photo:hover { border-color: var(--hair-2); transform: translateY(-2px); }
.photo__tile {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 1px 1px, var(--hair) 1px, transparent 0) 0 0 / 18px 18px,
    var(--bg-2);
}
.photo__tile .ph-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--fg-faint);
}
.photo__cap {
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
  border-top: 1px solid var(--hair);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.photo__cap .idx { color: var(--fg-faint); font-family: var(--font-mono); font-size: 0.75rem; }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
}
.lightbox[open],
.lightbox.open { display: flex; }
.lightbox__inner {
  background: var(--bg-1);
  border: 1px solid var(--hair-2);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  overflow: hidden;
}
.lightbox__stage {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  background:
    radial-gradient(circle at 1px 1px, var(--hair) 1px, transparent 0) 0 0 / 18px 18px,
    var(--bg-2);
}
.lightbox__stage img { width: 100%; height: 100%; object-fit: contain; }
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--hair);
}
.lightbox__cap { color: var(--fg); font-size: 0.9rem; }
.lightbox__nav { display: flex; gap: 0.5rem; }
.icon-btn {
  background: transparent;
  border: 1px solid var(--hair-2);
  color: var(--fg);
  border-radius: 999px;
  width: 40px; height: 40px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }

/* =========================================================================
   Contact
   ========================================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-1);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  color: inherit;
  transition: border-color .15s ease, transform .2s ease;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.contact-card .k {
  color: var(--fg-faint);
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}
.contact-card .v { color: var(--fg); font-size: 1rem; word-break: break-all; }
.contact-card:hover .v { color: var(--accent-ink); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--hair);
  padding-block: 2rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; padding: 0; }
.footer-links a {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}
.footer-links a:hover { color: var(--accent-ink); }
.footer-copy {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

/* =========================================================================
   Utilities / motion
   ========================================================================= */
.divider { border: none; border-top: 1px solid var(--hair); margin-block: 0; }

/* =========================================================================
   Responsive — collapse rail into a top bar (<= 860px)
   ========================================================================= */
@media (max-width: 860px) {
  body { padding-left: 0; padding-top: var(--bar-h); }

  .rail {
    top: 0; left: 0; right: 0; bottom: auto;
    width: auto;
    height: var(--bar-h);
    flex-direction: row;
    align-items: center;
    padding: 0 1.2rem;
    border-right: none;
    border-bottom: 1px solid var(--hair);
  }
  .rail__head { width: 100%; align-items: center; }
  .rail__brand { flex-direction: row; gap: 0.45rem; font-size: 0.82rem; }
  .rail__burger { display: inline-flex; }

  .theme-toggle { position: static; top: auto; right: auto; }

  .rail__panel {
    display: none;
    position: absolute;
    top: var(--bar-h);
    left: 0;
    right: 0;
    margin-top: 0;
    flex: none;
    padding: 1.4rem 1.5rem 1.75rem;
    background: var(--bg);
    border-bottom: 1px solid var(--hair);
    gap: 1.5rem;
  }
  .rail__panel.open { display: flex; }
  .rail__nav { gap: 1.15rem; }
  .rail__nav a { font-size: 0.85rem; }
  .rail__social { margin-top: 0; padding-top: 0.25rem; }

  .skip-link:focus { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
