/* baken.dev: the index's home and the crawler's page. Night blue, and the
   beacon's amber. */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --night: #0b1220; --night-2: #16223a; --on-night: #e2e8f0; --on-night-2: #a8b3c4;
    --paper: #fafaf9; --card: #fff; --text: #1a1a1a; --muted: #5b6474;
    --light: #fbbf24; --light-deep: #b45309; --accent: #c2410c;
    --border: rgba(15, 23, 42, 0.09);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: var(--paper); color: var(--text); line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; border-radius: 4px; }
code, pre { font-family: var(--mono); font-size: 0.88em; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }

/* The header: the mark, the name, two links. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.4rem; letter-spacing: -0.045em; }
.brand .mark { width: 34px; height: 34px; }
.top nav { display: flex; gap: 1.4rem; font-size: 0.95rem; }
.top nav a { color: inherit; opacity: 0.78; text-decoration: none; }
.top nav a:hover { opacity: 1; }

/* At night. */
.night { background: radial-gradient(1100px 620px at 78% 42%, var(--night-2) 0%, var(--night) 62%); color: var(--on-night); }
.night .brand .mark { color: var(--on-night); }

/* The hero. */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 2.5rem; padding-top: 2rem; padding-bottom: 4.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.76rem; font-weight: 650; color: var(--light); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.5rem, 6.2vw, 4.3rem); line-height: 1.02; letter-spacing: -0.05em; color: #fff; margin-bottom: 1.3rem; }
.hero h1 em { font-style: normal; color: var(--light); }
.hero .lead { font-size: 1.15rem; color: #c4cede; max-width: 34rem; margin-bottom: 2rem; }
.acts { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-flex; align-items: center; padding: 0.78rem 1.25rem; border-radius: 999px; font-weight: 650; font-size: 0.98rem; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.btn.primary { background: var(--light); color: #1c1917; }
.btn.primary:hover { background: #fcd34d; }
.btn.ghost { color: var(--on-night); border: 1px solid rgba(226, 232, 240, 0.32); }
.btn.ghost:hover { border-color: var(--on-night); }

/* The beacon: its light sweeps round, its rings reach further, and the sites
   it passes light up. The lantern is at the box's centre. */
.beacon { position: relative; width: min(470px, 100%); aspect-ratio: 1; margin: 0 auto; }
.beacon > * { position: absolute; }
.field {
    inset: 0; border-radius: 50%;
    background-image: radial-gradient(rgba(148, 163, 184, 0.5) 1px, transparent 1.7px); background-size: 17px 17px;
    -webkit-mask: radial-gradient(closest-side, #000 22%, transparent 100%); mask: radial-gradient(closest-side, #000 22%, transparent 100%);
}
.sweep {
    inset: 0; border-radius: 50%;
    background: conic-gradient(transparent 0deg, rgba(251, 191, 36, 0.03) 4deg, rgba(251, 191, 36, 0.26) 32deg, rgba(251, 191, 36, 0.55) 35deg, transparent 35.5deg);
    -webkit-mask: radial-gradient(closest-side, #000 8%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
    mask: radial-gradient(closest-side, #000 8%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
    animation: sweep 9s linear infinite;
}
.rings { inset: 0; }
.rings i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(251, 191, 36, 0.5); opacity: 0; transform: scale(0.06); animation: ring 9s ease-out infinite; }
.rings i:nth-child(2) { animation-delay: 2.25s; }
.rings i:nth-child(3) { animation-delay: 4.5s; }
.rings i:nth-child(4) { animation-delay: 6.75s; }
.lit { inset: 0; }
.lit i { position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--light); box-shadow: 0 0 10px 2px rgba(251, 191, 36, 0.55); opacity: 0; animation: lit 9s ease-out infinite; }
.tower { left: 24%; top: 35.375%; width: 52%; height: 52%; color: var(--on-night); filter: drop-shadow(0 0 22px rgba(251, 191, 36, 0.28)); }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes ring { 0% { opacity: 0.9; transform: scale(0.06); } 100% { opacity: 0; transform: scale(1); } }
@keyframes lit { 0% { opacity: 0; } 1.5% { opacity: 1; } 35% { opacity: 0.12; } 100% { opacity: 0; } }

/* The name, as a dictionary has it. */
.name { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3rem; align-items: center; padding-bottom: 1rem; }
.entry { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--light); border-radius: 6px 16px 16px 6px; padding: 1.6rem 1.8rem 1.4rem; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif; }
.entry .hw { font-size: clamp(2.4rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 0.35rem; }
.entry .ipa { font-size: 1.05rem; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 0.4rem; }
.entry .pos { font-style: italic; color: var(--muted); margin-bottom: 0.9rem; }
.entry .pos i { font-style: normal; }
.entry ol { padding-left: 1.4rem; margin-bottom: 0.9rem; font-size: 1.12rem; line-height: 1.55; }
.entry li { margin-bottom: 0.3rem; padding-left: 0.2rem; }
.entry li::marker { color: var(--light-deep); font-weight: 700; }
.entry .ety { font-size: 0.95rem; color: #4b5563; padding-top: 0.8rem; border-top: 1px dashed var(--border); }
.why { font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.4; letter-spacing: -0.02em; font-weight: 600; color: #262626; }

/* The sections. */
.section { padding-top: 4.5rem; padding-bottom: 4.5rem; }
.section h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.15; letter-spacing: -0.035em; margin-bottom: 0.75rem; }
.section .lead { color: var(--muted); font-size: 1.08rem; max-width: 42rem; margin-bottom: 2rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem 1.3rem 1.2rem; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.card h3 { font-size: 1.06rem; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.card p { color: #3b4351; font-size: 0.95rem; margin-bottom: 0.75rem; }
.card code { overflow-wrap: anywhere; background: rgba(15, 23, 42, 0.055); padding: 0.08em 0.35em; border-radius: 5px; }
.term { background: var(--night); color: var(--on-night); border-radius: 10px; padding: 0.8rem 0.95rem; font-size: 0.78rem; line-height: 1.55; overflow-x: auto; margin-bottom: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.term .p { color: var(--light); }
.snippet { position: relative; }
.snippet .term { padding-right: 4.5rem; }
.copy { position: absolute; top: 0.5rem; right: 0.5rem; font: 650 0.72rem/1 inherit; font-family: inherit; color: #1c1917; background: var(--light); border: 0; border-radius: 999px; padding: 0.4rem 0.65rem; cursor: pointer; }
.copy:hover { background: #fcd34d; }

.uses-band { background: #f1efe9; }
.uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin-top: 1.75rem; }
.uses h3 { font-size: 1.06rem; margin: 0.6rem 0 0.4rem; }
.uses p { color: #3b4351; font-size: 0.97rem; }
.ic { width: 30px; height: 30px; fill: none; stroke: var(--light-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.btn.mailbtn { background: var(--night); color: #fff; }
.btn.mailbtn:hover { background: var(--night-2); }

.foot { background: var(--night); color: var(--on-night-2); padding-top: 2.2rem; padding-bottom: 2.2rem; font-size: 0.88rem; }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.foot .brand { color: var(--on-night); font-size: 1.2rem; }
.foot .brand .mark { width: 28px; height: 28px; }
.foot a { color: #cbd5e1; }

/* The crawler's page: its words as CRAWL-SPEC has them, for reading. */
.pagehead { padding-top: 1.5rem; padding-bottom: 3rem; }
.pagehead h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.05em; color: #fff; margin-bottom: 1rem; }
.pagehead .intro { font-size: 1.15rem; color: #c4cede; max-width: 44rem; }
.doc { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 4.5rem; }
.doc h2 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.3rem; letter-spacing: -0.02em; margin: 2.4rem 0 0.7rem; scroll-margin-top: 1rem; }
.doc h2::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--light); box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.22); }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc ul, .doc pre { margin-bottom: 0.85rem; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.35rem; }
.doc li::marker { color: var(--light-deep); }
.doc code { background: rgba(15, 23, 42, 0.055); padding: 0.08em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }
.doc pre { background: var(--night); color: var(--on-night); border-radius: 10px; padding: 0.85rem 1rem; }
.doc .who { margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); }

@media (max-width: 880px) {
    .hero { grid-template-columns: minmax(0, 1fr); padding-bottom: 3rem; }
    .beacon { width: min(340px, 86%); }
    .cards, .uses, .name { grid-template-columns: minmax(0, 1fr); }
    .name { gap: 1.5rem; }
    .uses { gap: 1.5rem; }
    .section { padding-top: 3.25rem; padding-bottom: 3.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .sweep, .rings i, .lit i { animation: none; }
    .rings i { opacity: 0.3; }
    .rings i:nth-child(1) { transform: scale(0.3); }
    .rings i:nth-child(2) { transform: scale(0.55); }
    .rings i:nth-child(3) { transform: scale(0.8); }
    .rings i:nth-child(4) { transform: scale(1); }
    .lit i { opacity: 0.75; }
    .btn { transition: none; }
}
