/* Portfolio draft v2 — collage studio, editorial reading, notebook thanks.
   Gallery wall + bone paper + ink. Sohne for UI; Instrument Serif for longform.
   Instrument Serif is linked from each HTML shell. */

@font-face {
  font-family: "Sohne";
  src: url("/fonts/TestSohne-Leicht.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sohne";
  src: url("/fonts/TestSohne-Buch.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sohne";
  src: url("/fonts/TestSohne-Kraftig.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sohne";
  src: url("/fonts/TestSohne-Extrafett.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sohne Mono";
  src: url("/fonts/TestSohneMono-Buch.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --wall: #cfcbc4;
  --wall-deep: #b8b3aa;
  --paper: #f4f2ec;
  --sheet: #faf8f3;
  --ink: #141311;
  --ink-soft: #3a3834;
  --mute: #6f6b64;
  --line: rgba(20, 19, 17, 0.14);
  --line-strong: rgba(20, 19, 17, 0.28);
  --ochre: #b8892d;
  --moss: #3d5a45;
  --clay: #8c4a32;
  --slate: #2c3640;
  --sky: #6a8aa3;
  --rose: #a85d5d;
  --cite: #6f7a4e;
  --shadow: 0 18px 40px rgba(20, 19, 17, 0.12);
  --shadow-soft: 0 8px 24px rgba(20, 19, 17, 0.08);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --display: "Sohne", "Segoe UI", sans-serif;
  --body: "Sohne", "Segoe UI", sans-serif;
  --mono: "Sohne Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --chrome: calc(max(12px, env(safe-area-inset-top)) + 64px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body.draft-site {
  font-family: var(--body);
  font-weight: 400;
  background: var(--wall);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

.dr-top {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding:
    calc(10px + env(safe-area-inset-top))
    clamp(16px, 4vw, 40px)
    12px;
  background: var(--wall);
  border-bottom: 1px solid var(--line);
}

.dr-brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.dr-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: flex-end;
  align-items: center;
}

.dr-nav a,
.dr-mode button {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.dr-mode button {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
}

.dr-nav a:hover {
  border-bottom-color: currentColor;
}

.dr-mode button:hover {
  background: var(--ink);
  color: var(--paper);
}

.dr-nav a[aria-current="page"] {
  border-bottom-color: currentColor;
}

.dr-nav a.dr-live {
  color: var(--mute);
  border-bottom-color: transparent;
}

.dr-nav a.dr-live:hover {
  color: var(--ink);
  border-bottom-color: currentColor;
}

.dr-mode button[aria-pressed="true"] {
  background: var(--sheet);
  border-color: var(--ink);
}

.dr-layout-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
}

.dr-layout-links a {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}

.dr-layout-links a:hover {
  border-bottom-color: var(--ink);
}

/* ── Home: full-bleed photo, brand, one line, doors. Artistic and simple. ── */

body.draft-home {
  background: #0c1218;
  color: #f4f1ea;
}

body.draft-home .dr-top {
  display: none;
}

.dr-live-corner {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: clamp(16px, 4vw, 40px);
  z-index: 3;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(247, 244, 238, 0.78);
  border-bottom: 1px solid rgba(247, 244, 238, 0.4);
  padding-bottom: 2px;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.dr-live-corner:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.dr-home {
  width: 100%;
  margin: 0;
  padding: 0;
}

.dr-hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  align-content: end;
  overflow: hidden;
  color: #f4f1ea;
}

.dr-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.dr-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.04);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

.dr-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 12, 16, 0.28) 0%, rgba(8, 12, 16, 0.08) 28%, rgba(8, 12, 16, 0.35) 62%, rgba(8, 12, 16, 0.82) 100%);
  pointer-events: none;
}

.dr-hero-copy {
  position: relative;
  z-index: 2;
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 max(40px, env(safe-area-inset-bottom));
  animation: home-in 900ms var(--ease) both;
}

.dr-hero-copy .dr-brand-xl {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.8rem, 12vw, 7.5rem);
  letter-spacing: -0.055em;
  line-height: 0.86;
  color: #f7f4ee;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.dr-hero-copy .lede {
  margin-top: 18px;
  max-width: 28ch;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: rgba(247, 244, 238, 0.86);
  line-height: 1.4;
}

.dr-home-doors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.dr-home-doors a {
  color: rgba(247, 244, 238, 0.92);
  border-bottom: 1px solid rgba(247, 244, 238, 0.55);
  padding-bottom: 3px;
  transition: color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}

.dr-home-doors a:hover {
  color: #fff;
  border-color: #fff;
  transform: translateY(-1px);
}

.dr-field {
  background: #0c1218;
  color: #e8e4dc;
  padding: 0 0 72px;
}

.dr-field-frame {
  position: relative;
  width: 100%;
  min-height: 88dvh;
  overflow: hidden;
}

.dr-field-frame + .dr-field-frame {
  margin-top: 8px;
}

.dr-field-frame img {
  width: 100%;
  height: 100%;
  min-height: 88dvh;
  object-fit: cover;
  display: block;
}

.dr-field-frame figcaption {
  position: absolute;
  left: clamp(16px, 4vw, 40px);
  bottom: 22px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.78);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

@keyframes home-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(0, -1.2%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .dr-hero-media img { animation: none; transform: none; }
}

@media (max-width: 720px) {
  .dr-hero-copy {
    width: calc(100% - 32px);
    padding-bottom: 28px;
  }

  .dr-field-frame,
  .dr-field-frame img {
    min-height: 72dvh;
  }
}

/* ── Writing hub ── */

.dr-page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 96px;
}

.dr-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.dr-page-head h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.dr-page-head .lede {
  margin-top: 10px;
  max-width: 36ch;
  color: var(--ink-soft);
}

.dr-mode {
  display: flex;
  gap: 6px;
}

/* List mode — monospace numbered archive, centered like stack */
.dr-list {
  width: min(420px, 100%);
  margin: 28px auto 48px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  text-align: left;
}

.dr-list-title {
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
}

.dr-list ol {
  list-style: none;
  display: grid;
  gap: 22px;
  padding: 0;
  border: 0;
}

.dr-list a {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color 160ms var(--ease);
}

.dr-list a:hover { color: var(--moss); }
.dr-list .num { text-decoration: none; color: var(--mute); }
.dr-list .locked { opacity: 0.45; text-decoration: none; pointer-events: none; }

/* Stack mode */
.dr-stack-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 48px;
  gap: 0;
}

.dr-stack {
  position: relative;
  width: min(340px, 78vw);
  height: 440px;
  margin-bottom: 8px;
}

.dr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  padding: 12px 0 64px;
}

.dr-card {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 28px 24px;
  color: var(--paper);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 420ms var(--ease);
  cursor: grab;
  user-select: none;
  overflow: hidden;
}

.dr-card-static {
  position: relative;
  inset: auto;
  min-height: 300px;
  height: auto;
  transform: none;
  cursor: pointer;
}

.dr-card-static:active {
  cursor: pointer;
}

.dr-card-static:hover {
  transform: translateY(-3px);
}

.dr-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 19, 17, 0.08), rgba(20, 19, 17, 0.42));
  pointer-events: none;
}

.dr-card > * {
  position: relative;
  z-index: 1;
}

.dr-card:active { cursor: grabbing; }

.dr-card .meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
}

.dr-card h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 18px;
}

.dr-card p {
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: 0.9;
}

.dr-stack-pos {
  margin-top: 28px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1.4;
}

.dr-stack-hint {
  margin-top: 8px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  line-height: 1.4;
}

.dr-stack-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.dr-stack-nav button {
  border: 1px solid var(--line-strong);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--sheet);
}

.dr-stack-nav button:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── Essay editorial (Toolmen measure) ── */

body.draft-read {
  background: var(--sheet);
}

body.draft-read .dr-top {
  background: var(--sheet);
}

.dr-essay {
  width: min(680px, calc(100% - 48px));
  margin: 0 auto;
  padding: 12px 0 120px;
}

.dr-essay .date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 10px;
}

.dr-essay h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 14px;
  color: var(--ink-soft);
}

.dr-essay-ornament {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 32px;
}

.dr-essay-ornament span {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--ink);
}

.dr-essay-ornament span:nth-child(2) {
  width: 28px;
  height: 1px;
  background: var(--ink);
}

.dr-essay-ornament span:nth-child(3) {
  width: 4px;
  height: 4px;
}

.dr-epigraph {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 44px;
}

.dr-epigraph blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.dr-epigraph cite {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-style: normal;
  color: var(--cite);
  line-height: 1.5;
}

.dr-prose {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

.dr-prose p + p { margin-top: 1.15em; }

.dr-prose p:first-of-type::first-letter {
  float: left;
  font-size: 4.6rem;
  line-height: 0.8;
  padding: 0.08em 0.12em 0 0;
  font-weight: 400;
  color: var(--ink);
}

@media (max-width: 640px) {
  .dr-epigraph { grid-template-columns: 1fr; }
}

/* ── Preface asymmetric (Cyber Tenderness measure) ── */

body.draft-preface {
  background: var(--sheet);
}

body.draft-preface .dr-top {
  background: var(--sheet);
}

.dr-pref {
  min-height: calc(100dvh - var(--chrome));
  padding: clamp(28px, 5vw, 48px) 0 100px;
}

.dr-pref-frame {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
}

.dr-pref-titleblock h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  max-width: 11ch;
}

.dr-pref-titleblock h1 .line {
  display: block;
}

.dr-pref-titleblock h1 .line.a {
  margin-left: 0;
}

.dr-pref-titleblock h1 .line.b {
  margin-left: 0.55em;
  letter-spacing: -0.05em;
}

.dr-pref-titleblock h1 .line.c {
  margin-left: 1.35em;
  font-style: italic;
  letter-spacing: -0.03em;
}

.dr-pref-sub {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 28ch;
}

/* Title left, body right — same top line */
.dr-pref-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
  padding-top: 4px;
}

.dr-pref-column {
  width: min(520px, 100%);
  justify-self: end;
  padding-top: 0.15em;
}

.dr-pref-lede {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.dr-pref-dedication {
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.dr-pref-body {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink);
}

.dr-pref-body p + p { margin-top: 1.15em; }

.dr-pref-body .closing-poem {
  margin-top: 1.6em;
  font-style: italic;
}

@media (max-width: 720px) {
  .dr-pref-grid { grid-template-columns: 1fr; gap: 28px; }
  .dr-pref-column { justify-self: stretch; padding-top: 0; }
  .dr-pref-titleblock h1 .line.b { margin-left: 0.35em; }
  .dr-pref-titleblock h1 .line.c { margin-left: 0.85em; }
}

/* ── Thanks: same mono list language as CV / writing ── */

.dr-thanks {
  min-height: calc(100dvh - var(--chrome));
}

.dr-thanks .dr-cv-list {
  width: min(560px, 100%);
  margin: 8px auto 0;
}

.dr-thanks .dr-cv-list li {
  grid-template-columns: 2.4rem 1fr;
}

.dr-thanks .dr-cv-main .note {
  margin-top: 4px;
}

/* ── CV: same arrangement language as writing list ── */

.dr-cv {
  min-height: calc(100dvh - var(--chrome));
}

.dr-cv-current {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  max-width: 48ch;
}

.dr-cv-section {
  width: min(720px, 100%);
  margin: 0 auto 40px;
}

.dr-cv-list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.dr-cv-list li {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  gap: 10px;
  align-items: start;
  font-family: var(--mono);
  font-size: clamp(0.92rem, 2vw, 1.02rem);
}

.dr-cv-list .num {
  color: var(--mute);
}

.dr-cv-main {
  display: grid;
  gap: 4px;
}

.dr-cv-main a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.dr-cv-main a:hover { color: var(--moss); }

.dr-cv-main .note {
  color: var(--mute);
  font-size: 0.85em;
}

.dr-cv-list .year {
  color: var(--mute);
  white-space: nowrap;
}

.dr-footer-note {
  margin-top: 40px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

.dr-hidden { display: none !important; }

.dr-loading {
  padding: 80px 24px;
  text-align: center;
  font-family: var(--mono);
  color: var(--mute);
}

/* Night reading: warm charcoal paper. Driven by data-theme (toggle + OS default).
   Homepage keeps its own photo dark skin. */
html[data-theme="dark"] {
  color-scheme: dark;
  --wall: #1c1b19;
  --wall-deep: #121110;
  --paper: #e6e2d8;
  --sheet: #141311;
  --ink: #ece8e0;
  --ink-soft: #cfcabe;
  --mute: #8f8a80;
  --line: rgba(236, 232, 224, 0.12);
  --line-strong: rgba(236, 232, 224, 0.26);
  --moss: #9bb89f;
  --ochre: #d4a84a;
  --cite: #a8b87a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] ::selection {
  background: var(--paper);
  color: var(--sheet);
}

.dr-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 4px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  transition: color 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.dr-theme:hover {
  border-color: var(--ink);
}

.dr-theme svg {
  display: block;
  width: 14px;
  height: 14px;
}

.dr-theme .dr-theme-sun { display: none; }
.dr-theme .dr-theme-moon { display: block; }

html[data-theme="dark"] .dr-theme .dr-theme-sun { display: block; }
html[data-theme="dark"] .dr-theme .dr-theme-moon { display: none; }

/* Theme toggle lives in nav only; home photo skin does not flip. */
