/* dancomley.com — night signal.

   Deep indigo dark with a warm lamplight glow and film grain; a heavy
   grotesque (Bricolage) for display, a clean grotesk (Schibsted) for reading,
   the system mono for record-keeping. Hairline structure, big type, no
   JavaScript anywhere. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

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

:root {
  color-scheme: dark;
  --void: #0a0c15;   /* deepest ground */
  --night: #10131f;  /* raised surfaces */
  --paper: #eae6db;  /* warm off-white */
  --dim: #a49b8a;    /* secondary text */
  --faint: #746e63;  /* tertiary: dates, chrome */
  --lamp: #e2a558;   /* everything warm hangs off this */
  --lamp-bright: #f2c078;
  --rule: rgba(233, 228, 214, 0.11);
  --glass: rgba(233, 228, 214, 0.045);
  --frame: 64rem;    /* the page frame */
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

/* The lamp: warm light from beyond the top-right corner, a cold violet depth
   low on the left. Fixed, so the light stays put while the page scrolls. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(48rem 34rem at 85% -12%, rgba(226, 165, 88, 0.16), transparent 62%),
    radial-gradient(40rem 30rem at 108% 8%, rgba(226, 165, 88, 0.07), transparent 55%),
    radial-gradient(52rem 40rem at -10% 110%, rgba(96, 82, 158, 0.13), transparent 65%),
    linear-gradient(180deg, #0e1120, var(--void) 58%);
}

/* Film grain over the light, under the words. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--night);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--lamp);
  border-radius: 6px;
  z-index: 10;
}

a {
  color: var(--lamp);
  text-decoration-color: rgba(226, 165, 88, 0.4);
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}
a:hover { color: var(--lamp-bright); text-decoration-color: currentColor; }

::selection { background: rgba(226, 165, 88, 0.28); }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 2px; }

.site-header, main, .site-footer {
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--paper);
  text-decoration: none;
}
.wordmark:hover { color: var(--paper); }

nav[aria-label="Primary"] {
  display: flex;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
nav[aria-label="Primary"] a { color: var(--dim); text-decoration: none; }
nav[aria-label="Primary"] a:hover { color: var(--lamp-bright); }

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 {
  font-weight: 800;
  font-size: clamp(2.3rem, 4vw + 1rem, 3.6rem);
  margin-block: 0 0.75rem;
}
h2 { font-size: 1.5rem; font-weight: 700; margin-block: 2.5rem 0.75rem; }
h3 { font-size: 1.2rem; font-weight: 700; margin-block: 2rem 0.5rem; }

.lede {
  color: var(--dim);
  font-size: 1.15rem;
  margin-top: 0;
  max-width: 38rem;
}
.meta {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin-block: 0.5rem 0;
}
.empty { color: var(--dim); }

/* --- home ---------------------------------------------------------------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
  column-gap: 3.5rem;
  align-items: center;
  padding-block: clamp(3rem, 9vh, 5.5rem) 2.5rem;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lamp);
  margin: 0 0 1.25rem;
}
.intro h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}
.intro .prose { color: var(--dim); font-size: 1.15rem; line-height: 1.6; max-width: 30rem; }

.intro-art { margin: 0; }
.intro-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--night);
}

/* Wide banner artwork on index pages: a thin cinematic strip. */
.page-art { margin: 2.25rem 0 0; }
.page-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--night);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  margin: 3.5rem 0 0;
}

/* --- the ledger ----------------------------------------------------------
   Date in the left column, mono, like a logbook entry; the title carries the
   voice. Collapses to stacked on small screens. */

.post-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.post-item {
  display: grid;
  grid-template-columns: 9rem 1fr;
  column-gap: 2.5rem;
  padding-block: 2rem;
}
.post-item + .post-item { border-top: 1px solid var(--rule); }
.post-item .meta {
  grid-column: 1;
  margin: 0;
  padding-top: 0.55em; /* optically align with the display cap height */
  font-size: 0.75rem;
}
.post-item h2 {
  grid-column: 2;
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.post-item h2 a { color: var(--paper); text-decoration: none; }
.post-item h2 a::after { content: " →"; color: var(--lamp); opacity: 0; transition: opacity 0.15s ease; }
.post-item h2 a:hover { color: var(--lamp-bright); }
.post-item h2 a:hover::after { opacity: 1; }
.excerpt { grid-column: 2; margin: 0.6rem 0 0; color: var(--dim); font-size: 1rem; max-width: 38rem; }

.more { margin-top: 1.75rem; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; }
.more a { text-decoration: none; }
.more a:hover { text-decoration: underline; }

/* --- posts ---------------------------------------------------------------- */

.post-cover { margin: 2rem 0 0.5rem; }
.post-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: var(--night);
}

.post-header {
  padding: 1.75rem 0 1.75rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}
.post-header h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin-top: 0.4rem; }

.tags { margin: 1.1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  color: var(--dim);
  background: var(--glass);
}
.tag:hover { border-color: rgba(226, 165, 88, 0.5); color: var(--lamp-bright); }

.toc {
  background: var(--glass);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.1rem 1.4rem 1.2rem;
  margin-bottom: 2.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.toc h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.75rem;
}
.toc ol { margin: 0; padding-left: 1.2rem; font-size: 0.92rem; line-height: 1.5; }
.toc li { margin-block: 0.45rem; }
.toc a { color: var(--dim); text-decoration: none; }
.toc a:hover { color: var(--lamp-bright); }

/* On a wide screen the article becomes two columns: a comfortable reading
   measure on the left, the contents panel sticky in the margin. The cover and
   header span both. Row 3 is pinned so the pairing holds with or without a
   cover; an unused row collapses to nothing. */
@media (min-width: 64rem) {
  .post { display: grid; grid-template-columns: minmax(0, 44rem) 1fr; column-gap: 3.5rem; }
  .post > * { grid-column: 1; }
  .post .post-cover, .post .post-header { grid-column: 1 / -1; }
  .post .prose { grid-column: 1; grid-row: 3; }
  .post .toc { grid-column: 2; grid-row: 3; align-self: start; position: sticky; top: 2rem; margin-bottom: 0; }
}

.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin-block: 1.3rem; }
.prose { max-width: 44rem; }
.prose h2, .prose h3, .prose h4 { color: var(--paper); scroll-margin-top: 2.5rem; }
.prose h2 { margin-block: 2.75rem 0.9rem; letter-spacing: -0.015em; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); }

.prose figure { margin: 2.25rem 0; }
.prose figure img { display: block; width: 100%; }
.prose figcaption {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--faint);
}

blockquote {
  margin-inline: 0;
  padding-left: 1.4rem;
  border-left: 2px solid rgba(226, 165, 88, 0.55);
  color: var(--dim);
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--glass);
  border: 1px solid var(--rule);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}

pre {
  background: rgba(6, 8, 14, 0.55);
  border: 1px solid var(--rule);
  padding: 1.05rem 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

hr { border: 0; border-top: 1px solid var(--rule); margin-block: 3rem; }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose table { display: block; overflow-x: auto; }
th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
th, td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--rule); }

.post-nav { margin-block: 3.5rem 0; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; }
.post-nav a { text-decoration: none; color: var(--dim); }
.post-nav a:hover { color: var(--lamp-bright); }

/* --- footer ---------------------------------------------------------------- */

.site-footer {
  margin-top: 5.5rem;
  padding-block: 1.6rem 3.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--lamp-bright); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 0.6rem; }
.site-footer p { margin: 0; }

/* --- motion ----------------------------------------------------------------
   One orchestrated moment on the home page and a slow breath in the lamp.
   Off entirely under reduced motion. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes lamp-breathe {
    from { opacity: 0.82; }
    to { opacity: 1; }
  }
  body::before { animation: lamp-breathe 16s ease-in-out infinite alternate; }
  .intro > * { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .intro > :nth-child(2) { animation-delay: 0.12s; }
  .recent { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.24s both; }
}

@media (max-width: 52rem) {
  .intro { display: block; }
  .intro-art { margin-top: 2.25rem; }
}

@media (max-width: 40rem) {
  .site-header { padding-block: 1.2rem; }
  .intro { padding-block: 3rem 2rem; }
  .post-item { display: block; padding-block: 1.6rem; }
  .post-item .meta { padding-top: 0; margin-bottom: 0.45rem; }
  .post-item h2 { font-size: 1.5rem; }
}

@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  body::before, body::after { display: none; }
  .skip, nav[aria-label="Primary"], .post-nav, .site-footer, .toc { display: none; }
  a, .wordmark, .dot { color: #111; }
  a { text-decoration: none; }
}
