/* MagByte — site styles */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #F6F6F4;
  --ink: #16181A;
  --ink-2: #2B2F33;
  --muted: #4A5056;
  --muted-2: #5F666D;
  --rule: #DCDCD8;
  --accent: #44596B;
  --dark-muted: #A9B0B7;
  --dark-muted-2: #B9BFC5;
  --dark-rule: #2E3236;
  --band: #16181A;
  --on-band: #F6F6F4;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Dark theme: set on <html data-theme="dark"> by the script in index.html */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111315;
  --ink: #ECEDEA;
  --ink-2: #D5D8DB;
  --muted: #A9B0B7;
  --muted-2: #8B9299;
  --rule: #2A2E32;
  --accent: #93A9BC;
  --band: #1A1D20;
  --on-band: #ECEDEA;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--ink); }
a:hover { color: var(--muted); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
@media (max-width: 560px) { .wrap { padding-left: 20px; padding-right: 20px; } }

.mono { font-family: var(--mono); }
.label { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.section { border-top: 1px solid var(--rule); }
.section .wrap { padding-top: 88px; padding-bottom: 88px; }
.h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }

/* Skip link */
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 8px; color: var(--bg); }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; }
.logo { font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; padding: 12px 0; }
.logo span { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 32px; margin-left: auto; }
.nav a { font-size: 14px; text-decoration: none; padding: 12px 0; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav a.strong { color: var(--ink); font-weight: 500; }

/* Theme switch */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; background: none; border: 0; color: var(--muted-2); cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-toggle .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle[aria-checked="false"] .sun, .theme-toggle[aria-checked="true"] .moon { color: var(--ink); }
.theme-toggle .track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--muted-2); transition: background 0.25s; }
.theme-toggle .thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); transition: transform 0.25s; }
.theme-toggle[aria-checked="true"] .track { background: var(--accent); }
.theme-toggle[aria-checked="true"] .thumb { transform: translateX(16px); }
@media (prefers-reduced-motion: reduce) { .theme-toggle .track, .theme-toggle .thumb { transition: none; } }

/* Colour fade while switching themes; the class is added briefly by the switch script */
.theme-fading, .theme-fading *, .theme-fading *::before, .theme-fading *::after {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, outline-color 0.25s ease, fill 0.25s ease, stroke 0.25s ease, transform 0.25s ease !important;
}

/* Hero */
.hero { padding-top: clamp(72px, 12vw, 152px); padding-bottom: clamp(72px, 10vw, 128px); display: flex; flex-direction: column; gap: 28px; }
.hero h1 { max-width: 860px; font-size: clamp(38px, 6vw, 68px); line-height: 1.06; font-weight: 600; letter-spacing: -0.03em; }
.lede { max-width: 620px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 500; text-decoration: none; border-radius: 2px; }
.btn:hover { background: var(--ink-2); color: var(--bg); }
.link { display: inline-flex; align-items: center; min-height: 48px; font-size: 15px; text-underline-offset: 4px; }

/* Services */
.services .wrap { display: flex; flex-direction: column; gap: 48px; }
.heading { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.card { background: var(--bg); padding: 32px 28px 36px; display: flex; flex-direction: column; gap: 12px; }
.card .num { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }
.card h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.card p { font-size: 15px; color: var(--muted); }

/* Two-column sections */
.split .wrap { display: flex; flex-wrap: wrap; gap: 40px 64px; }
.split .heading { flex: 1 1 280px; }
.split .body { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; gap: 4px 32px; padding: 24px 0; border-top: 1px solid var(--rule); }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row h3 { flex: 0 0 220px; font-size: 16px; font-weight: 600; }
.row p { flex: 1 1 280px; font-size: 15px; color: var(--muted); }
.about .body { gap: 16px; }
.about .body p { max-width: 620px; font-size: 15px; color: var(--muted); }
.about .body p.first { font-size: 17px; color: var(--ink-2); }

/* Contact + footer */
.contact { background: var(--band); color: var(--on-band); }
.contact .wrap { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 20px; }
.contact .label { color: var(--dark-muted); }
.contact h2 { max-width: 720px; font-size: clamp(28px, 4vw, 44px); line-height: 1.12; font-weight: 600; letter-spacing: -0.025em; }
.rotator { display: grid; overflow: hidden; padding-block: 0.1em; }
.rotator span { grid-area: 1 / 1; opacity: 0; transform: translateY(100%); transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.5s; }
.rotator span:not(.is-active):not(.is-leaving) { transition: none; }
.rotator .is-active { opacity: 1; transform: none; }
.rotator .is-leaving { opacity: 0; transform: translateY(-100%); }
.contact p { max-width: 560px; color: var(--dark-muted-2); }
.contact a { align-self: flex-start; display: inline-flex; align-items: center; min-height: 48px; margin-top: 12px; font-family: var(--mono); font-size: clamp(16px, 2vw, 20px); color: var(--on-band); text-underline-offset: 6px; overflow-wrap: anywhere; }
.contact a:hover { color: var(--dark-muted-2); }
.contact a:focus-visible { outline-color: var(--on-band); }

.site-footer { background: var(--band); color: var(--dark-muted); border-top: 1px solid var(--dark-rule); }
.site-footer .wrap { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; font-size: 13px; }
