/* iamjeeves.dev: the Candlelight look from Tablewright (dark brown paper, brass, double rules), set in Alegreya. */

@font-face { font-family: "Alegreya"; src: url(/fonts/alegreya.woff2) format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url(/fonts/alegreya-italic.woff2) format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya SC"; src: url(/fonts/alegreya-sc-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --paper: #1a140f; --band: #140f0b; --card: #251d15; --well: #1f1811;
  --ink: #f2e7d0; --ink-2: #d8c6a5; --ink-3: #bfab89;
  --rule: #4a3a29; --rule-strong: #8a6f4b;
  --brass: #dcb56b; --brass-fill: #b8893a; --brass-soft: #3a2d1b;
  --crimson: #ef9a8e; --ok: #96cfa0; --warn: #e9b86c; --party: #8cc1d8; --focus: #e9c47e;
  --serif: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, P052, "Book Antiqua", Georgia, serif;
  --caps: "Alegreya SC", "Iowan Old Style", "Palatino Linotype", Palatino, P052, Georgia, serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--band); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background: radial-gradient(ellipse 80% 520px at 50% -60px, #2e2318 0%, rgb(26 20 15 / 0) 100%), var(--paper);
  font: 400 19px/1.55 var(--serif); font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
/* candle: the glow at the top breathes a little; paper grain over everything */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 560px; pointer-events: none;
  background: radial-gradient(ellipse 46% 300px at 50% -40px, rgb(233 196 126 / .07), transparent 100%);
  animation: candle 7s ease-in-out infinite;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .92 0 0 0 0 .8 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes candle { 0%, 100% { opacity: 1; } 35% { opacity: .78; } 52% { opacity: .95; } 70% { opacity: .84; } }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); position: relative; z-index: 1; }
@media (min-width: 720px) { .wrap { padding: 0 40px; } }

.caps { font-family: var(--caps); font-weight: 500; letter-spacing: .08em; text-transform: lowercase; }
a { color: var(--brass); text-decoration-thickness: 1px; text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--brass-soft); color: var(--ink); }

/* ---- rules -------------------------------------------------------------------------------------------- */
.rule.double { height: 5px; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }

/* ---- masthead ----------------------------------------------------------------------------------------- */
.mast { padding-top: clamp(18px, 4vw, 40px); text-align: center; }
.nameplate { padding: clamp(22px, 4.4vw, 40px) 0 clamp(14px, 2.6vw, 22px); display: grid; justify-items: center; }
.seal { width: clamp(58px, 9vw, 76px); height: auto; transform: rotate(-6deg); filter: drop-shadow(0 3px 6px rgb(0 0 0 / .55)); }
h1 {
  margin: clamp(10px, 2vw, 16px) 0 0; font: 500 clamp(64px, 14.5vw, 136px)/.9 var(--caps);
  letter-spacing: .035em; color: var(--ink); text-shadow: 0 0 42px rgb(233 196 126 / .12);
  text-transform: none; margin-right: -.035em; /* tracking hangs on the right; keep it optically centred */
}
.trade {
  margin: clamp(10px, 1.6vw, 14px) 0 0; font: 500 clamp(15px, 1.9vw, 18px)/1.2 var(--caps); text-transform: lowercase;
  letter-spacing: .24em; margin-right: -.24em; color: var(--brass);
}
.dateline {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap;
  border-top: 1px solid var(--rule); padding: 9px 2px 10px; font-size: 15px; color: var(--ink-3);
}
.dateline > :only-child { margin: 0 auto; }
.lamp { display: inline-flex; align-items: center; gap: 9px; }
.lamp i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgb(150 207 160 / .14), 0 0 10px rgb(150 207 160 / .55); }
.lamp.warn i { background: var(--warn); box-shadow: 0 0 0 3px rgb(233 184 108 / .14), 0 0 10px rgb(233 184 108 / .5); }
.lamp.quiet i { background: var(--rule-strong); box-shadow: none; }
@media (max-width: 560px) { .dateline { justify-content: center; text-align: center; } }

/* ---- section heads ------------------------------------------------------------------------------------- */
.head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0;
  font: 500 15px/1.2 var(--caps); text-transform: lowercase; letter-spacing: .14em; color: var(--brass);
  padding-bottom: 9px; border-bottom: 1px solid var(--rule);
}
.head .meta { color: var(--ink-3); letter-spacing: .1em; font-family: var(--serif); font-style: italic; text-transform: none; font-size: 16px; }
main > * { margin-top: clamp(40px, 7vw, 72px); }

/* ---- plate: the rack ----------------------------------------------------------------------------------- */
.plate { margin-left: 0; margin-right: 0; }
.plate-body { display: grid; gap: clamp(18px, 4vw, 48px); align-items: center; padding-top: clamp(18px, 3vw, 28px); }
@media (min-width: 860px) { .plate-body { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.rack { width: 100%; height: auto; display: block; overflow: visible; }
.key { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.key li + li { border-top: 1px solid rgb(74 58 41 / .6); }
.key button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; min-height: 48px; padding: 9px 6px;
  display: grid; grid-template-columns: 1.3em 6.2em minmax(0, 1fr); align-items: baseline; column-gap: 10px;
  border-radius: 3px; transition: background-color .2s var(--ease);
}
.key button:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.key i { font-style: italic; font-weight: 500; color: var(--brass); font-size: 19px; text-align: center; }
.key b { font: 500 16px/1.3 var(--caps); text-transform: lowercase; letter-spacing: .1em; color: var(--ink); }
.key span { color: var(--ink-3); font-style: italic; font-size: 17px; line-height: 1.35; }
.key data { font-style: normal; font-variant-numeric: lining-nums tabular-nums; color: var(--ink-2); }
.plate[data-active] .key button[aria-pressed="true"], .key button:hover { background: rgb(58 45 27 / .55); }
.plate[data-active] .key button[aria-pressed="true"] b { color: var(--brass); }
@media (max-width: 420px) { .key button { grid-template-columns: 1.1em 5.4em minmax(0, 1fr); column-gap: 8px; } .key span { font-size: 16px; } }

/* rack drawing */
.rack .post { fill: var(--well); stroke: var(--ink-3); stroke-width: .9; }
.rack .face { fill: var(--card); stroke: var(--ink-3); stroke-width: .8; }
.rack .face.well { fill: var(--well); }
.rack .ear { fill: var(--well); stroke: var(--ink-3); stroke-width: .6; }
.rack .screw { fill: var(--rule-strong); }
.rack .hole { fill: var(--band); stroke: var(--rule-strong); stroke-width: .5; }
.rack .hatch { fill: url(#hatch); }
.rack .hatch-line { stroke: #5c4934; stroke-width: .7; }
.rack .port { fill: var(--band); stroke: var(--ink-3); stroke-width: .5; }
.rack .bay { fill: var(--well); stroke: var(--ink-3); stroke-width: .6; }
.rack .slot { fill: var(--band); stroke: var(--rule-strong); stroke-width: .5; }
.rack .vent { fill: url(#dots); }
.rack .perf { fill: #0c0907; }
.rack .outline { fill: none; stroke: var(--ink-3); stroke-width: .6; }
.rack .fine { stroke: var(--rule-strong); stroke-width: .55; fill: none; }
.rack .line { stroke: var(--ink-3); stroke-width: .7; fill: none; }
.rack .leader { stroke: var(--brass-fill); stroke-width: .7; }
.rack .letter { fill: var(--brass); font: italic 500 16px var(--serif); }
.rack .plaque { fill: var(--brass-soft); stroke: var(--brass-fill); stroke-width: .6; }
.rack .brass { fill: none; stroke: var(--brass-fill); stroke-width: 1.4; stroke-linecap: round; }
.rack .btn { fill: var(--well); stroke: var(--ink-3); stroke-width: .6; }
.rack .ring-brass { stroke: var(--brass-fill); stroke-width: 1.2; }
.rack .glyph { fill: none; stroke: var(--ink-3); stroke-width: .8; stroke-linecap: round; }
.rack .brass-glyph { stroke: var(--brass); stroke-width: 1.1; }
.rack .lcd { fill: #15232a; stroke: var(--rule-strong); stroke-width: .6; }
.rack .lcd-line { stroke: rgb(140 193 216 / .45); stroke-width: .9; stroke-linecap: round; }
.rack .lcd-line-box { fill: none; stroke: var(--party); stroke-width: .7; }
.rack .lcd-fill { fill: var(--party); }
.rack .lcd-text { fill: var(--party); font: 500 13px var(--caps); letter-spacing: .04em; font-variant-numeric: lining-nums; }
.rack .ring { fill: none; stroke: var(--ink-3); stroke-width: 1.1; }
.rack .cable { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.rack .cable.c1 { stroke: #6e8c97; } .rack .cable.c2 { stroke: #9a5d52; } .rack .cable.c3 { stroke: #8b7a5c; }
.rack .well-fill { fill: var(--well); }
.rack .mesh { fill: url(#mesh); }
.rack .mesh-bg { fill: rgb(37 29 21 / .62); }
.rack .mesh-hole { fill: rgb(12 9 7 / .9); }
.rack .blade { fill: rgb(184 137 58 / .32); stroke: var(--brass-fill); stroke-width: .5; }
.rack .fan-frame { fill: var(--band); stroke: var(--rule-strong); stroke-width: .8; }
.rack .fan-sweep { fill: none; stroke: none; }
.rack .fan { transform-box: fill-box; transform-origin: 50% 50%; animation: spin 5.5s linear infinite; }
.rack .hl { fill: none; stroke: var(--brass); stroke-width: 1.6; opacity: 0; transition: opacity .2s var(--ease); }

/* LEDs: dark until their machine powers on (battery first, then the servers, then the network), then the
   activity lights flicker. site.js gives each its own rhythm; without it they hold steady. */
.rack .led { opacity: 0; animation: led-on 1ms linear var(--boot, .3s) forwards; }
.rack .led.g { fill: var(--ok); } .rack .led.a { fill: var(--warn); } .rack .led.b { fill: var(--party); }
.rack .led.off { fill: #3b3024; opacity: 1; animation: none; }
.rack .led.halo { fill-opacity: .2; }
.rack .led.act { animation: led-on 1ms linear var(--boot, .3s) forwards, var(--fk, none) var(--d, 2s) steps(1, end) calc(var(--boot, .3s) + var(--o, 0s)) infinite; }
.rack [data-unit="ups"] { --boot: .5s; }
.rack [data-unit="s2"] { --boot: .9s; }
.rack [data-unit="s1"] { --boot: 1.1s; }
.rack [data-unit="ws"] { --boot: 1.3s; }
.rack [data-unit="sw"] { --boot: 1.55s; }
.rack [data-unit="fw"] { --boot: 1.75s; }
@keyframes led-on { to { opacity: 1; } }
@keyframes fk-a { 0% { opacity: 1; } 8% { opacity: .12; } 12% { opacity: 1; } 47% { opacity: .12; } 50% { opacity: 1; } 71% { opacity: .2; } 77% { opacity: 1; } }
@keyframes fk-b { 0% { opacity: .15; } 30% { opacity: 1; } 36% { opacity: .15; } 38% { opacity: 1; } 80% { opacity: .2; } 85% { opacity: 1; } }
@keyframes fk-c { 0% { opacity: 1; } 3% { opacity: .2; } 6% { opacity: 1; } 9% { opacity: .2; } 12% { opacity: 1; } 60% { opacity: .15; } 64% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* pointing at a key line, or at the drawing, picks out that machine */
.rack .unit, .rack .rack-part, .rack .frame, .rack .mark { transition: opacity .25s var(--ease); }
.plate[data-active] .rack .unit:not(.on), .plate[data-active] .rack .rack-part, .plate[data-active] .rack .frame,
.plate[data-active] .rack .mark:not(.on) { opacity: .38; }
.plate[data-active] .rack .unit.on .hl { opacity: 1; }
.rack .unit { cursor: pointer; }

/* ---- day book ------------------------------------------------------------------------------------------ */
/* label, figure, note: subgrid keeps every figure on one line whatever the labels wrap to */
.daybook dl { margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto auto auto; }
.daybook dl > div { padding: 22px 18px 6px; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; align-content: start; }
.daybook dl > div + div { border-left: 1px solid var(--rule); }
.daybook dt { font: 500 14px/1.25 var(--caps); text-transform: lowercase; letter-spacing: .1em; color: var(--ink-2); align-self: end; }
.daybook dd { margin: 0; display: contents; }
.daybook .n { align-self: end; }
.daybook .n {
  font: 500 clamp(34px, 4.6vw, 50px)/1 var(--serif); color: var(--ink); font-variant-numeric: oldstyle-nums tabular-nums;
  letter-spacing: -.01em;
}
.daybook .n.frac { font-variant-numeric: diagonal-fractions; }
.daybook small { font-style: italic; font-size: 15.5px; color: var(--ink-3); }
@media (max-width: 860px) {
  .daybook dl { grid-template-columns: 1fr; grid-template-rows: none; }
  .daybook dl > div { grid-row: auto; grid-template-rows: auto auto; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px; padding: 14px 2px; }
  .daybook dl > div + div { border-left: 0; border-top: 1px solid rgb(74 58 41 / .6); }
  .daybook dt { grid-row: 1 / span 2; align-self: center; font-size: 15.5px; }
  .daybook .n { grid-column: 2; grid-row: 1; text-align: right; font-size: clamp(30px, 8vw, 40px); }
  .daybook small { grid-column: 2; grid-row: 2; text-align: right; font-size: 14.5px; }
}

/* ---- built & kept here ------------------------------------------------------------------------------------ */
/* three rows: the network, identity, the platform. Separators only ever sit between two things on a line. */
.kept .rows { padding-top: 22px; font: 500 clamp(17px, 2.1vw, 20px)/2 var(--caps); text-transform: lowercase; letter-spacing: .07em; color: var(--ink-2); }
.kept ul { list-style: none; margin: 0; padding: 0; text-align: center; }
.kept li { display: inline; white-space: nowrap; }
.kept li + li::before { content: "·"; color: var(--brass-fill); margin: 0 .6em 0 .5em; letter-spacing: 0; }
@media (max-width: 760px) {
  .kept .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; line-height: 1.3; font-size: 15px; letter-spacing: .05em; }
  .kept ul { display: contents; }
  .kept li { display: block; white-space: normal; text-align: left; padding: 11px 0; border-bottom: 1px solid rgb(74 58 41 / .45); }
  .kept li + li::before { content: none; }
}

/* ---- doors ---------------------------------------------------------------------------------------------- */
.doors ul { list-style: none; margin: 0; padding: 26px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .doors ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.doors a {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 10px 16px; min-height: 44px;
  text-decoration: none; color: var(--ink); border-radius: 6px; border: 1px solid var(--rule);
  background: linear-gradient(180deg, rgb(37 29 21 / .9), rgb(31 24 17 / .9));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .04), 0 1px 2px rgb(0 0 0 / .35);
  transition: border-color .2s var(--ease), transform .2s var(--ease), background-color .2s var(--ease);
}
.doors a > span:last-child { font: 500 16px/1.2 var(--caps); text-transform: lowercase; letter-spacing: .12em; }
.doors a:hover { border-color: var(--brass-fill); transform: translateY(-2px); }
.doors a:hover > span:last-child { color: var(--brass); }
.doors a:active { transform: translateY(0); }
.stamp {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #c79a4a, #7c5a1c 70%); color: #fbe9dc;
  font: 500 27px/1 var(--caps); text-shadow: 0 1px 1px rgb(0 0 0 / .45);
  box-shadow: inset 0 0 0 2px rgb(251 233 220 / .16), inset 0 -3px 6px rgb(0 0 0 / .35), 0 2px 6px rgb(0 0 0 / .5);
  transition: transform .25s var(--ease);
}
.doors a:hover .stamp { transform: rotate(-8deg); }
.key-stamp svg { width: 26px; height: 26px; fill: #fbe9dc; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .45)); }

/* ---- colophon ------------------------------------------------------------------------------------------- */
.colophon { margin-top: clamp(48px, 8vw, 88px); padding-bottom: max(28px, env(safe-area-inset-bottom)); text-align: center; }
.colophon p { margin: 14px 0 0; font-size: 14.5px; color: var(--ink-3); letter-spacing: .1em; line-height: 1.9; }
.colophon .sep { color: var(--brass-fill); margin: 0 .5em; }
@media (max-width: 560px) { .colophon .sep { display: block; height: 0; overflow: hidden; } }

/* ---- the opening: rules draw, the seal stamps, the page settles ------------------------------------------ */
.draw { transform-origin: 50% 50%; animation: draw .9s var(--ease) both; }
.mast .draw:last-child { animation-delay: .12s; }
.seal { animation: stamp .55s var(--ease) .28s both; }
h1, .trade, .dateline { animation: settle .7s var(--ease) both; }
h1 { animation-delay: .38s; } .trade { animation-delay: .5s; } .dateline { animation-delay: .6s; }
main > * { animation: settle .8s var(--ease) both; }
main > :nth-child(1) { animation-delay: .7s; } main > :nth-child(2) { animation-delay: .85s; }
main > :nth-child(3) { animation-delay: 1s; } main > :nth-child(4) { animation-delay: 1.1s; }
.colophon { animation: settle .8s var(--ease) 1.2s both; }
@keyframes draw { from { transform: scaleX(0); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-20deg) scale(1.35); } 70% { opacity: 1; transform: rotate(-4deg) scale(.97); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }
@keyframes settle { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rack .led { opacity: 1; }
  .seal { transform: rotate(-6deg); }
}
@media (forced-colors: active) { .stamp, .lamp i { forced-color-adjust: none; } }
