/* danielesco.com — "charcoal & void"
   Language: cream sketch paper · charcoal gesture · light as unmarked paper
   Source study: Tadao Ando, Church of the Light concept sketch */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;1,9..144,300;1,9..144,400&family=Archivo:wght@300;400;500&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --paper: #f5f0e2;
  --paper2: #ede7d5;
  --ink: #26221c;
  --ink-rgb: 38, 34, 28;       /* growth.js graphite */
  --ink-soft: #3b362e;
  --body-ink: #55503f;
  --gray: #7d766a;
  --hairline: #26221c1e;
  --hairline2: #26221c38;
  --ph: #9a917b;
  color-scheme: light;
}

/* ---------- dark mode: silverpoint on dark paper ----------
   light mode = pencil on cream (dark marks, light ground; light = unmarked paper)
   dark mode  = chalk on charcoal (light marks, dark ground; light = the glowing stroke) */
[data-theme="dark"] {
  --paper: #16140f;
  --paper2: #201d16;
  --ink: #ece5d2;
  --ink-rgb: 236, 229, 210;
  --ink-soft: #ded7c4;
  --body-ink: #b7af9c;
  --gray: #8f8775;
  --hairline: #ece5d216;
  --hairline2: #ece5d230;
  --ph: #6f6857;
  color-scheme: dark;
}

/* the drawn ink (charcoal #26221c) becomes chalk; the warm scumble too */
[data-theme="dark"] [stroke="#26221c"] { stroke: var(--ink); }
[data-theme="dark"] [fill="#26221c"]   { fill: var(--ink); }
[data-theme="dark"] [fill="#2b2620"]   { fill: var(--ink); }

/* the hero study stays a *negative*: a soft dark mass with the light cross glowing
   (Ando's Church of the Light, at night) — keep its masses dark, let fill="#f5f0e2" glow */
[data-theme="dark"] .study [fill="#2b2620"] { fill: #2c281f; }
[data-theme="dark"] .study [fill="#26221c"] { fill: #34301f; }
[data-theme="dark"] .study [stroke="#26221c"] { stroke: var(--gray); }

/* the footer title-block band stays a dark panel (its text is already cream) */
[data-theme="dark"] .footer [fill="#26221c"] { fill: #26221c; }
[data-theme="dark"] .refs li:target { background: #2a261d; }

/* solid charcoal *bands* inside diagrams (e.g. the "crystallized rules" stratum)
   carry cream text on them — keep them dark instead of inverting to a light block */
[data-theme="dark"] figure.diagram rect[fill="#26221c"] { fill: #2f2b20; }

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* paper grain */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.15 0 0 0 0 0.13 0 0 0 0 0.10 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 48px; position: relative; z-index: 1; }

.note {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 2.5px; text-transform: uppercase; color: var(--gray);
}
.note b { color: var(--ink); font-weight: 500; }

h1, h2, h3 { font-family: 'Fraunces', serif; color: var(--ink); }

/* ---------- nav ---------- */
.nav { display: flex; justify-content: space-between; align-items: baseline; padding: 28px 0 20px; }
.nav .name { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 500; letter-spacing: -.2px; color: var(--ink); text-decoration: none; }
.nav .links { display: flex; gap: 30px; }
.nav .links a { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gray); text-decoration: none; transition: color .2s; }
.nav .links a:hover, .nav .links a.active { color: var(--ink); }
.nav .links a.ig { display: inline-flex; align-items: center; gap: 7px; }
.nav .links a.ig span { text-transform: lowercase; letter-spacing: 1.2px; }
.ig-icon { width: 13px; height: 13px; display: block; flex: none; }
@media (max-width: 760px) { .nav .links a.ig span { display: none; } }

/* theme toggle — a half-filled disc (the contrast switch), hand-rough */
.theme-toggle { background: none; border: none; cursor: pointer; padding: 0; margin: 0; display: inline-flex; align-items: center; color: var(--gray); transition: color .2s; line-height: 0; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 15px; height: 15px; display: block; }
.theme-toggle .disc-fill { transition: transform .45s cubic-bezier(.4,0,.2,1); transform-origin: 8px 8px; }
[data-theme="dark"] .theme-toggle .disc-fill { transform: rotate(180deg); }
.nav-stroke { display: block; width: 100%; height: 7px; }

/* ---------- hero (home) ---------- */
.hero { padding: 100px 0 80px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 80px; align-items: center; }
.hero .note { margin-bottom: 32px; }
.hero h1 { font-weight: 300; font-size: clamp(46px, 6.4vw, 82px); line-height: 1.04; letter-spacing: -2px; }
.hero h1 em { font-style: italic; font-weight: 400; }
.hero .sub { margin-top: 34px; font-size: 16.5px; font-weight: 300; color: var(--body-ink); max-width: 480px; line-height: 1.75; }
.hero .sub strong { color: var(--ink); font-weight: 500; }

.study { position: relative; aspect-ratio: 4/5; max-width: 360px; justify-self: end; width: 100%; }
.study svg { width: 100%; height: 100%; display: block; }

/* the charcoal breathes — geometry still, only tone drifts (gradient-gentle).
   Opacity animates on the filtered groups, so the GPU composites it without
   re-rendering the turbulence. Offset periods keep the layers out of phase. */
@keyframes charcoal-breath { from { opacity: 1; } to { opacity: .72; } }
.study .l-halo { animation: charcoal-breath 13s ease-in-out infinite alternate; }
.study .l-mid  { animation: charcoal-breath  9s ease-in-out infinite alternate -4s; }
.study .l-core { animation: charcoal-breath 17s ease-in-out infinite alternate -9s; }
@media (prefers-reduced-motion: reduce) {
  .study .l-halo, .study .l-mid, .study .l-core { animation: none; }
}
.study .cap {
  position: absolute; bottom: -30px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 1.5px; color: var(--gray);
}

/* dimension string */
.dimstring { margin-top: 70px; position: relative; height: 30px; }
.dimstring .line { position: absolute; top: 14px; left: 0; right: 0; height: 1px; background: var(--hairline2); }
.dimstring .tick { position: absolute; top: 9px; width: 1px; height: 11px; background: var(--ink); transform: rotate(28deg); opacity: .55; }
.dimstring .num {
  position: absolute; top: -8px; transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 1px; color: var(--gray); background: var(--paper); padding: 0 8px; white-space: nowrap;
}

/* ---------- page head (interior pages) ---------- */
.page-head { padding: 90px 0 26px; }
.page-head h1 { font-weight: 300; font-size: clamp(40px, 5.6vw, 68px); letter-spacing: -1.8px; line-height: 1.04; }
.page-head h1 em { font-style: italic; font-weight: 400; }
.page-head .sub { margin-top: 22px; font-size: 16px; font-weight: 300; color: var(--body-ink); max-width: 560px; line-height: 1.75; }

/* ---------- position / statement ---------- */
.position { padding: 100px 0 80px; }
.position .note { margin-bottom: 30px; }
.position h2 { font-weight: 300; font-size: clamp(30px, 4vw, 50px); line-height: 1.18; letter-spacing: -1px; max-width: 820px; }
.position h2 em { font-style: italic; }
.position .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; margin-top: 44px; max-width: 900px; }
.position .cols p { font-size: 15px; font-weight: 300; color: var(--body-ink); line-height: 1.8; }
.position .cols p strong { color: var(--ink); font-weight: 500; }

/* ---------- work figures ---------- */
.work { padding: 40px 0 30px; }
.work-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.work-head h2 { font-weight: 400; font-size: 30px; letter-spacing: -.6px; }
.work-head a { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--gray); text-decoration: none; }
.work-head a:hover { color: var(--ink); }

.fig-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; align-items: end; padding: 40px 0; text-decoration: none; color: inherit; }
.fig-row.rev { grid-template-columns: 1fr 1.6fr; }
.fig-row.rev .fig { order: 2; }
.fig {
  aspect-ratio: 16/9; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper2); overflow: visible;
}
.fig img, .fig video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fig .corner { position: absolute; width: 54px; height: 54px; opacity: .9; z-index: 2; pointer-events: none; }
.fig .corner svg { width: 100%; height: 100%; }
.fig .c-tl { top: -8px; left: -8px; }
.fig .c-br { bottom: -8px; right: -8px; transform: rotate(180deg); }
.fig .ph { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 2px; color: var(--ph); text-transform: uppercase; padding: 4px 10px; text-align: center; line-height: 2; }
.fig-meta .no { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 2px; color: var(--gray); display: block; margin-bottom: 14px; }
.fig-meta h3 { font-size: 24px; font-weight: 400; letter-spacing: -.4px; margin-bottom: 10px; }
.fig-row:hover .fig-meta h3 { font-style: italic; }
.fig-meta p { font-size: 13.5px; font-weight: 300; color: var(--gray); line-height: 1.7; max-width: 340px; }
.fig-meta .tags { margin-top: 12px; font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 1.5px; color: #9a917b; text-transform: uppercase; }

/* ---------- writing list ---------- */
.writing { padding: 60px 0 110px; }
.post-row { display: grid; grid-template-columns: 130px 64px 1fr auto; gap: 30px; align-items: baseline; padding: 26px 0; border-top: 1px solid var(--hairline2); text-decoration: none; color: inherit; }
.post-row .mark { width: 60px; height: 60px; align-self: center; display: block; }
.post-row:last-of-type { border-bottom: 1px solid var(--hairline2); }
.post-row .date { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 1.5px; color: var(--gray); }
.post-row h3 { font-size: 23px; font-weight: 400; letter-spacing: -.4px; position: relative; }
/* hover: roman and italic layers crossfade instead of snapping.
   The incoming layer leads and the outgoing layer lingers, so the
   combined ink never thins mid-fade — reads as one continuous morph. */
.post-row h3 .r { transition: opacity 1s cubic-bezier(.25,.1,.25,1) .12s; }
.post-row h3::after {
  content: attr(data-i); position: absolute; left: 0; top: 0; width: 100%;
  font-style: italic; opacity: 0; transition: opacity 1s cubic-bezier(.25,.1,.25,1) .12s;
}
.post-row:hover h3 .r { opacity: 0; transition-delay: .18s; }
.post-row:hover h3::after { opacity: 1; transition-delay: 0s; }
.post-row .sub { font-size: 13.5px; font-weight: 300; color: var(--gray); margin-top: 6px; line-height: 1.6; font-family: 'Archivo', sans-serif; max-width: 620px; }
.post-row .arr { color: var(--gray); }
/* hover: the mark redraws itself, stroke by stroke */
.post-row .mark .d { stroke-dasharray: 1 1; }
.post-row:hover .mark .d { animation: mark-draw .55s ease both; }
.post-row:hover .mark .d2 { animation-delay: .12s; }
.post-row:hover .mark .d3 { animation-delay: .32s; }
.post-row:hover .mark .d4 { animation-delay: .52s; }
.post-row:hover .mark .ink { animation: mark-ink .35s ease both; animation-delay: .9s; }
@keyframes mark-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mark-ink { from { opacity: 0; } to { opacity: .7; } }
@media (prefers-reduced-motion: reduce) {
  .post-row:hover .mark .d, .post-row:hover .mark .ink { animation: none; }
}
@media (max-width: 700px) { .post-row { grid-template-columns: 1fr; gap: 8px; } .post-row .mark { display: none; } }

/* ---------- article (essay) ---------- */
.article-head { max-width: 850px; margin: 90px auto 30px; padding: 0 48px; }
.article-head .note { margin-bottom: 26px; }
/* the essay's mark, stamped at the head — draws itself on arrival */
.article-head .mark { width: 76px; height: 76px; display: block; margin-bottom: 22px; }
.article-head .mark .d { stroke-dasharray: 1 1; animation: mark-draw .65s ease both; }
.article-head .mark .d1 { animation-delay: .25s; }
.article-head .mark .d2 { animation-delay: .45s; }
.article-head .mark .d3 { animation-delay: .75s; }
.article-head .mark .d4 { animation-delay: 1s; }
.article-head .mark .ink { animation: mark-ink .4s ease both; animation-delay: 1.5s; }
@media (prefers-reduced-motion: reduce) {
  .article-head .mark .d, .article-head .mark .ink { animation: none; }
}
.article-head h1 { font-weight: 300; font-size: clamp(34px, 4.6vw, 54px); letter-spacing: -1.6px; line-height: 1.1; }
.article-head .standfirst { margin-top: 26px; font-family: 'Fraunces', serif; font-style: italic; font-weight: 300; font-size: 20px; color: var(--body-ink); line-height: 1.6; }
.article-meta { display: flex; gap: 26px; margin-top: 30px; font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--gray); }

.prose { max-width: 790px; margin: 0 auto; padding: 30px 48px 40px; }
.prose p { font-family: 'Fraunces', serif; font-weight: 400; font-size: 17.5px; color: var(--ink-soft); line-height: 1.8; margin-bottom: 24px; letter-spacing: .1px; }
.prose p strong { color: var(--ink); font-weight: 500; }
.prose p em { font-style: italic; }
.prose h2 { font-weight: 400; font-size: 25px; letter-spacing: -.5px; margin: 58px 0 20px; line-height: 1.25; }
.prose h2 .num { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 2.5px; color: var(--gray); margin-bottom: 12px; font-weight: 400; }
.prose blockquote { margin: 34px 0; padding: 4px 0 4px 28px; border-left: 2.5px solid var(--ink); }
.prose blockquote p { font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; color: var(--ink); line-height: 1.95; margin: 0; }
.prose ul, .prose ol { margin: 0 0 24px 24px; }
.prose li { font-family: 'Fraunces', serif; font-size: 17px; color: var(--ink-soft); line-height: 1.75; margin-bottom: 10px; }
.prose li strong { color: var(--ink); font-weight: 500; }
.prose .pull { font-family: 'Fraunces', serif; font-weight: 300; font-style: italic; font-size: 26px; line-height: 1.45; color: var(--ink); margin: 48px 0; letter-spacing: -.4px; }
.prose figure { margin: 40px 0; }
.prose figure img, .prose figure video { width: 100%; display: block; }
.prose figure.diagram { margin: 52px 0; }
.prose figure.diagram svg { width: 100%; height: auto; display: block; }
.prose figure.diagram figcaption { text-align: center; font-size: 10.5px; letter-spacing: 1.8px; }
.prose figure.diagram text { font-family: 'IBM Plex Mono', monospace; }
.prose figcaption { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 1.5px; color: var(--gray); margin-top: 12px; text-transform: uppercase; }
.stroke-divider { display: block; width: 200px; height: 8px; margin: 54px auto; }

/* references */
.refs { max-width: 790px; margin: 30px auto 90px; padding: 0 48px; }
.refs h2 { font-weight: 400; font-size: 21px; margin-bottom: 8px; }
.refs h3 { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gray); margin: 28px 0 12px; font-weight: 500; }
.refs ul { list-style: none; }
.refs li { font-size: 13px; font-weight: 300; color: var(--body-ink); line-height: 1.65; padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.refs li em { font-style: italic; }
.refs li a { color: inherit; }
.refs li a:hover { color: var(--ink); }
.refs .refno { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--gray); margin-right: 8px; }
.refs li:target { background: #ece5d2; }

/* in-text citations */
.prose .cite { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; line-height: 0; vertical-align: super; letter-spacing: 0; white-space: nowrap; }
.prose .cite a { color: var(--gray); text-decoration: none; }
.prose .cite a:hover { color: var(--ink); }

/* ---------- media embeds (project pages) ---------- */
.embed { position: relative; width: 100%; aspect-ratio: 16/9; margin: 36px 0; background: var(--paper2); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 36px 0; }
.media-grid img { width: 100%; display: block; }
@media (max-width: 700px) { .media-grid { grid-template-columns: 1fr; } }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 70px; padding: 30px 0 90px; align-items: start; }
.about-grid .bio p { font-family: 'Fraunces', serif; font-size: 17px; color: var(--ink-soft); line-height: 1.8; margin-bottom: 22px; }
.about-grid .bio p strong { color: var(--ink); font-weight: 500; }
.facts { border-top: 1px solid var(--hairline2); }
.facts .row { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.facts .k { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray); padding-top: 3px; }
.facts .v { font-size: 14px; font-weight: 300; color: var(--ink-soft); line-height: 1.6; }
.facts .v a { color: inherit; }

/* ---------- footer: charcoal block + title block ---------- */
.footer { position: relative; z-index: 1; color: var(--paper); margin-top: 60px; }
.footer .charcoal-bg { position: absolute; inset: 0; }
.footer .charcoal-bg svg { width: 100%; height: 100%; display: block; }
.tblock { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; }
.tblock > div { padding: 34px 26px 40px; border-right: 1px solid #f5f0e21f; }
.tblock .lab { font-family: 'IBM Plex Mono', monospace; font-size: 8.5px; letter-spacing: 2px; color: #f5f0e266; text-transform: uppercase; display: block; margin-bottom: 10px; }
.tblock .val { font-size: 13px; font-weight: 300; color: #f5f0e2d8; }
.tblock .val a { color: inherit; text-decoration: none; }
.tblock .val a:hover { color: #fff; }
.tblock .sig { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 400; font-style: italic; }
@media (max-width: 800px) {
  .tblock { grid-template-columns: 1fr 1fr; }
  .hero-grid, .position .cols, .fig-row, .fig-row.rev, .about-grid { grid-template-columns: 1fr; }
  .fig-row.rev .fig { order: 0; }
  .study { justify-self: start; }
  .wrap, .article-head, .prose, .refs { padding-left: 28px; padding-right: 28px; }
}
