/* bytery.dev — hand-written, no build step.
   Palette and type rules: projects/Bytery/brand/bytery/README.md */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #f7f4ef;
  --ink: #1e1a17;
  --crust: #a15724;     /* brand #A85E28, darkened to 4.9:1 on the off-white paper */
  --crown: #cc7d3f;
  --link: #8f4b1c;      /* 6.0:1 on paper; body text stays off the 4.5:1 crust */
  --muted: #6b5d53;     /* 5.8:1 on paper */
  --line: rgba(30, 26, 23, 0.17);
  --line-soft: rgba(30, 26, 23, 0.1);
  --card: rgba(255, 255, 255, 0.42);
  --glow: rgba(204, 125, 63, 0.2);
  --mark-shadow: 0 22px 44px rgba(30, 26, 23, 0.1);
}

/* Dark, unless the theme toggle has forced light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #1e1a17;
    --ink: #f6efe3;
    --crust: #d9894a;      /* 6.3:1 on ink */
    --crown: #eba867;
    --link: #d9894a;
    --muted: #cbbfaf;      /* 9.5:1 on ink */
    --line: rgba(246, 239, 227, 0.2);
    --line-soft: rgba(246, 239, 227, 0.11);
    --card: rgba(246, 239, 227, 0.045);
    --glow: rgba(217, 137, 74, 0.16);
    --mark-shadow: 0 22px 44px rgba(0, 0, 0, 0.35);
  }
}

/* Dark, forced by the theme toggle. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1e1a17;
  --ink: #f6efe3;
  --crust: #d9894a;
  --crown: #eba867;
  --link: #d9894a;
  --muted: #cbbfaf;
  --line: rgba(246, 239, 227, 0.2);
  --line-soft: rgba(246, 239, 227, 0.11);
  --card: rgba(246, 239, 227, 0.045);
  --glow: rgba(217, 137, 74, 0.16);
  --mark-shadow: 0 22px 44px rgba(0, 0, 0, 0.35);
}

/* Theme-aware art: one of each pair is shown, CSS-only, so the site still
   follows the system theme with JavaScript switched off. */
.for-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .for-light { display: none; }
  :root:not([data-theme="light"]) .for-dark { display: inline; }
}
:root[data-theme="dark"] .for-light { display: none; }
:root[data-theme="dark"] .for-dark { display: inline; }

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.65 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* A warm light from the top right, like an oven door left ajar. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(820px 540px at 74% -10%, var(--glow), transparent 67%);
}

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

img { max-width: 100%; height: auto; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(100% - 2.75rem, 940px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  z-index: 20;
}
.skip:focus { left: 1rem; top: 1rem; }

/* Header ------------------------------------------------------------------ */

.site-head { padding-block: 1.5rem; }

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: inline-flex; line-height: 0; }
.brand img {
  height: clamp(30px, 4.4vw, 38px);
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.theme-toggle:hover { color: var(--link); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font: 500 0.75rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--link); border-bottom-color: var(--line); }
.site-nav .gh-icon {
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.3em;
  vertical-align: -0.12em;
  fill: currentColor;
}

/* Hero -------------------------------------------------------------------- */

main { flex: 1; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(2rem, 7vw, 5.5rem);
  padding-block: clamp(3.25rem, 10vh, 6.5rem) clamp(3rem, 8vh, 5rem);
}

.hero h1 {
  margin: 0;
  max-width: 27ch;
  font-size: clamp(1.6rem, 3.6vw, 2.55rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero h1 a { text-decoration-thickness: 2px; }

.hero-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(150px, 22vw, 210px);
  /* reserve room for the halo (inset -14%) so it never widens the page */
  margin-inline-end: min(3.1vw, 30px);
  aspect-ratio: 1;
}
.hero-mark::before {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 46%, var(--glow), transparent 68%);
}
.hero-mark img {
  position: relative;
  width: 100%;
  filter: drop-shadow(var(--mark-shadow));
}

/* Shelf ------------------------------------------------------------------- */

.shelf { padding-bottom: clamp(3.5rem, 9vh, 6rem); }

.shelf-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}
.shelf-head h2 {
  margin: 0;
  font: 500 0.72rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--crust);
  white-space: nowrap;
}
.shelf-rule { flex: 1; height: 1px; background: var(--line); }

.empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: clamp(2.25rem, 6vw, 3.4rem) clamp(1.35rem, 4vw, 2.5rem);
  text-align: center;
  background:
    radial-gradient(320px 130px at 50% 0%, var(--glow), transparent 72%),
    var(--card);
}

.empty-kicker {
  margin: 0 0 0.85rem;
  font: 500 0.68rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.empty-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.3rem, 2.4vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.empty-note {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--muted);
  text-wrap: pretty;
}
.empty-note a { white-space: nowrap; }

/* 404 --------------------------------------------------------------------- */

.notfound {
  padding-block: clamp(4rem, 14vh, 9rem);
  max-width: 38rem;
}
.notfound-code {
  margin: 0 0 1.1rem;
  font: 500 0.72rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.18em;
  color: var(--crust);
}
.notfound h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.notfound-note { margin: 0 0 1.6rem; color: var(--muted); font-size: 1.05rem; }
.notfound-link { margin: 0; }
.notfound-link a { font-weight: 500; }

/* Footer ------------------------------------------------------------------ */

.site-foot {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding-block: 1.4rem 2rem;
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font: 400 0.75rem/1.6 "JetBrains Mono", ui-monospace, monospace;
  color: var(--muted);
}
.site-foot p { margin: 0; }
.site-foot a { color: var(--ink); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

/* Motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .hero-mark,
  .empty {
    animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }
  .hero-mark { animation-delay: 0.06s; }
  .empty { animation-delay: 0.12s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Small screens ----------------------------------------------------------- */

@media (max-width: 720px) {
  .wrap { width: min(100% - 2.25rem, 940px); }
  .hero { grid-template-columns: 1fr; padding-block: 2.75rem 3rem; }
  .hero h1 { max-width: none; }
  .hero-mark { display: none; }
  .empty { text-align: left; }
  .empty-note { margin-inline: 0; }
}
