/* DESIGN SETTINGS — every color, font and layout value lives here.
   Change the look of the whole site by editing this file only. */
:root {
  /* page */
  --color-paper: #f7f6f2;
  --color-ink: #202824;
  --color-muted: #616b62;
  --color-accent: #526c54;
  --color-line: #d5d9d0;
  --color-surface: #eeeee7; /* boxes like the 10-second takeaway */

  /* drawing plates (the dark drafting-sheet panels).
     For classic blueprint blue try: --color-plate: #173a5e; --color-plate-fill: #1d4670; --color-plate-frame: #4e7398; */
  --color-plate: #1c231f;
  --color-plate-fill: #26302a;
  --color-plate-line: #e9ebe3;
  --color-plate-dim: #97a294;
  --color-plate-frame: #3d4a41;
  --color-plate-grid: rgba(233, 235, 227, .045);
  --color-plate-grid-major: rgba(233, 235, 227, .09);
  --color-ray: #bdcd8f;
  --color-glass: rgba(189, 205, 143, .18);
  --color-redline: #e8866a;

  /* type */
  --font-body: Inter, Arial, Helvetica, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --text-page-title: clamp(2rem, 5vw, 3.2rem);
  --text-card-title: 1.2rem;
  --text-body: 1.05rem;

  /* layout */
  --page-width: 1000px;      /* homepage grid */
  --reading-width: 680px;    /* project pages and writing */
  --gutter: 24px;            /* side padding */
  --columns: 3;              /* project grid columns on desktop */
  --gap-x: 32px;
  --gap-y: 52px;
  --tile-ratio: 4 / 3;       /* shape of project images on the homepage */
  --header-top: 40px;
  --section-gap: 44px;
  --page-bottom: 112px;
  --image-max-height: 520px; /* tallest a photo can be on a project page */
  --radius: 3px;
}

@media (max-width: 900px) {
  :root { --columns: 2; --gap-y: 44px; }
}
@media (max-width: 560px) {
  :root { --columns: 1; --gutter: 20px; --gap-y: 40px; --tile-ratio: 3 / 2; --header-top: 28px; --section-gap: 28px; --page-bottom: 72px; }
}

/* COMPONENTS — uses the values from settings.css. You shouldn't need to edit this to add content. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); line-height: 1.6; }
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--color-accent); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 5px; }
::selection { background: var(--color-line); }

.wrap {
  max-width: calc(var(--page-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: 16px; top: -100px; background: var(--color-paper); padding: 12px; z-index: 10; }
.skip:focus { top: 0; }

/* header / footer */
.site-header { padding-block: var(--header-top) 0; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { font-weight: 600; letter-spacing: -.04em; font-size: 1.15rem; text-decoration: none; }
.nav { display: flex; gap: 24px; font-size: .9rem; }
.nav a { text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.nav a[aria-current="page"] { text-decoration: underline; }
.site-footer { border-top: 1px solid var(--color-line); padding-block: 24px 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--color-muted); }
.site-footer nav { display: flex; gap: 20px; }

/* section label (mono, ruled) */
.section-label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 2px solid var(--color-ink); padding-top: 14px; margin: var(--section-gap) 0 32px; }
.section-label h1, .section-label h2 { margin: 0; font: 500 .75rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.section-label a { font-size: .85rem; }

/* project grid */
.grid { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: var(--gap-y) var(--gap-x); padding-bottom: var(--page-bottom); }
.card { display: flex; flex-direction: column; gap: 14px; min-width: 0; text-decoration: none; }
.card h2 { margin: 0; font-weight: 500; font-size: var(--text-card-title); line-height: 1.25; letter-spacing: -.02em; }
.card p { margin: 6px 0 0; color: var(--color-muted); font-size: .92rem; line-height: 1.5; }
.card .plate { transition: transform .25s ease; }
.card:hover .plate { transform: translateY(-3px); }
.card:hover h2 { color: var(--color-accent); }

/* plate: dark drafting sheet holding a drawing or photo */
.plate {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: var(--tile-ratio); max-width: 100%;
  background-color: var(--color-plate);
  background-image:
    linear-gradient(var(--color-plate-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-plate-grid-major) 1px, transparent 1px),
    linear-gradient(var(--color-plate-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-plate-grid) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}
.plate::after { content: ""; position: absolute; inset: 8px; border: 1px solid var(--color-plate-frame); pointer-events: none; }
.plate > svg { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); }
.plate > img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: cover; }

/* project page + writing page */
.page-head { max-width: var(--reading-width); margin: var(--section-gap) auto 32px; }
.back { display: inline-block; font-size: .9rem; margin-bottom: 28px; }
.page-head h1 { margin: 0 0 12px; font-size: var(--text-page-title); line-height: 1.08; font-weight: 500; letter-spacing: -.05em; text-wrap: balance; }
.lede { margin: 0; color: var(--color-muted); font-size: 1.12rem; }
.meta { font: 500 .75rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent); margin: 0 0 12px; }
.hero { max-width: calc(var(--reading-width) + 160px); margin: 0 auto 44px; }
.hero .plate { aspect-ratio: 16 / 9; }
.hero .plate > img, .plate > img[src$=".svg"] { object-fit: contain; }
.plate > .zoom { position: absolute; inset: 0; cursor: zoom-in; }
.plate > .zoom > img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }

.prose { max-width: var(--reading-width); margin: 0 auto; padding-bottom: var(--page-bottom); font-size: var(--text-body); }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose li { color: var(--color-muted); }
.prose p { margin-bottom: 0; }
.prose strong { color: var(--color-ink); font-weight: 600; }
.prose h2 { margin: 2.2em 0 0; font-size: 1.55rem; line-height: 1.2; font-weight: 500; letter-spacing: -.03em; color: var(--color-ink); }
.prose h3 { margin: 1.8em 0 0; font-size: 1.15rem; font-weight: 600; color: var(--color-ink); }
.prose ul, .prose ol { padding-left: 1.2em; margin-bottom: 0; display: grid; gap: .4em; }
.prose a { color: var(--color-ink); }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--color-line); padding: 1px 5px; border-radius: 3px; }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: 18px; border-left: 3px solid var(--color-accent); }
.prose blockquote p { color: var(--color-ink); font-size: 1.15rem; }
.prose figure { margin: 2em 0 0; }
.prose figure img { display: block; width: auto; max-width: 100%; height: auto; max-height: var(--image-max-height); margin: 0 auto; border-radius: var(--radius); }
.prose figure .plate { aspect-ratio: auto; padding: 20px; }
.prose figure .plate > svg { position: static; display: block; width: 100%; height: auto; }
.prose figcaption { font-size: .8rem; color: var(--color-muted); margin-top: 8px; }
.prose .gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 2em; }
.prose .gallery figure { margin: 0; }
.prose .gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: var(--color-line); max-height: none; }

/* writing: read at your depth */
.levels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.levels a { font: 500 .75rem var(--font-mono); letter-spacing: .04em; text-decoration: none; border: 1px solid var(--color-line); border-radius: 99px; padding: 6px 12px; }
.levels a:hover { border-color: var(--color-accent); }
.prose .takeaway { margin: 0; padding: 18px 20px; border-left: 3px solid var(--color-accent); background: var(--color-surface); color: var(--color-ink); font-size: 1.22rem; line-height: 1.45; letter-spacing: -.01em; }
.takeaway span { display: block; font: 500 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--color-accent); margin-bottom: 6px; }
.prose h2 { scroll-margin-top: 24px; }
.cite { font-size: .7em; line-height: 0; margin-left: 1px; }
.cite + .cite::before { content: ","; color: var(--color-muted); }
.cite a { text-decoration: none; color: var(--color-accent); font-weight: 600; }
.sources { margin-top: 3em; padding-top: 1px; border-top: 1px solid var(--color-line); }
.sources h2 { font-size: 1rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em; }
.sources ol { font-size: .88rem; }
.sources li { overflow-wrap: anywhere; scroll-margin-top: 24px; }
.sources li:target { background: var(--color-surface); }

/* writing list */
.post-list { list-style: none; padding: 0; margin: 0 0 var(--page-bottom); max-width: var(--reading-width); }
.post-list li { border-bottom: 1px solid var(--color-line); }
.post-list a { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding-block: 16px; text-decoration: none; }
.post-list time { font: 400 .8rem var(--font-mono); color: var(--color-muted); padding-top: 3px; }
.post-list b { display: block; font-weight: 500; font-size: 1.1rem; letter-spacing: -.01em; }
.post-list .desc { color: var(--color-muted); font-size: .92rem; }
.post-list a:hover b { color: var(--color-accent); }

/* drawing line work inside plates (SVG classes) */
.drawing text { font-family: var(--font-mono); fill: var(--color-plate-line); }
.drawing .note { font-size: 13px; letter-spacing: .06em; }
.drawing .dim-note, .drawing .sub { fill: var(--color-plate-dim); }
.drawing .dim-t { font-size: 15px; }
.drawing .dim-t.big { font-size: 17px; }
.drawing .label { font-size: 17px; }
.drawing .sub { font-size: 12.5px; }
.drawing .ok-t, .drawing .ray-t { fill: var(--color-ray); }
.drawing .bad-t { fill: var(--color-redline); }
.drawing .center { stroke: var(--color-plate-dim); stroke-width: 1; stroke-dasharray: 22 5 3 5; fill: none; }
.drawing .rod { stroke: var(--color-plate-line); stroke-width: 6; stroke-linecap: round; fill: none; }
.drawing .hid { stroke: var(--color-plate-dim); stroke-width: 1.5; stroke-dasharray: 7 5; fill: none; }
.drawing .ln-thin { stroke: var(--color-plate-line); stroke-width: 1.3; fill: none; }
.drawing .part, .drawing .box { fill: var(--color-plate-fill); stroke: var(--color-plate-line); stroke-width: 1.5; }
.drawing .box-acc { fill: var(--color-glass); stroke: var(--color-ray); stroke-width: 1.5; }
.drawing .knob { fill: var(--color-plate-line); }
.drawing .spring { stroke: var(--color-plate-line); stroke-width: 1.2; fill: none; }
.drawing .hid-spring { stroke: var(--color-plate-dim); stroke-dasharray: 3 3; }
.drawing .glass { fill: var(--color-glass); stroke: var(--color-plate-line); stroke-width: 1.5; }
.drawing .mirror-flat { stroke: var(--color-plate-line); stroke-width: 4; stroke-linecap: round; }
.drawing .focal { stroke: var(--color-ray); stroke-width: 1; stroke-dasharray: 4 4; }
.drawing .ray, .drawing .ray-line { stroke: var(--color-ray); stroke-width: 1.6; fill: none; }
.drawing .ray.faint { opacity: .45; stroke-width: 1; }
.drawing .ray-head { fill: var(--color-ray); }
.drawing .dim, .drawing .ext { stroke: var(--color-plate-dim); stroke-width: 1; fill: none; }
.drawing .dim-head { fill: var(--color-plate-line); }
.drawing .dim-bg { fill: var(--color-plate); }
.drawing .grid { stroke: var(--color-plate-grid-major); stroke-width: 1; }
.drawing .limit { stroke: var(--color-plate-line); stroke-width: 2.2; fill: none; }
.drawing .zone-ok { fill: var(--color-ray); opacity: .1; }
.drawing .pt { fill: var(--color-plate); stroke: var(--color-plate-line); stroke-width: 2; }
.drawing .pt.key { fill: var(--color-ray); stroke: var(--color-ray); }
.drawing .flow { stroke-dasharray: 10 8; animation: ray-flow 1.6s linear infinite; }
@keyframes ray-flow { to { stroke-dashoffset: -36; } }

@media (max-width: 560px) {
  .post-list a { grid-template-columns: 1fr; gap: 2px; }
  .prose .gallery { grid-template-columns: 1fr; }
  .hero .plate { aspect-ratio: 4 / 3; }
  .nav { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .drawing .flow { animation: none; stroke-dasharray: none; }
  .card .plate { transition: none; }
}
