/* stephengriffin.uk – shared styles for the home page and the website pages. */
:root {
  /* Palette shared with stephengriffin.co.uk */
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1f1f23;
  --text-2: #45454e;
  --muted: #5b5b66;
  --line: #e2e2de;
  --accent: #bc1b32;
  --accent-dark: #93142a;
  --accent-soft: #f8e4e7;
  --on-accent: #ffffff;
  --header: #16161a;
  --header-text: #e6e6ea;
  --header-line: #16161a;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 14px rgb(0 0 0 / .05);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --wrap: 1080px;
}
/* Dark palette: follows the system unless the visitor has picked a theme with the toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121214;
    --surface: #1b1b1f;
    --text: #ececef;
    --text-2: #b9b9c2;
    --muted: #8e8e99;
    --line: #2c2c32;
    --accent: #f0566b;
    --accent-dark: #ff8090;
    --accent-soft: #3a1419;
    --on-accent: #121214;
    --header: #0b0b0d;
    --header-text: #e6e6ea;
    --header-line: #2c2c32;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #121214;
  --surface: #1b1b1f;
  --text: #ececef;
  --text-2: #b9b9c2;
  --muted: #8e8e99;
  --line: #2c2c32;
  --accent: #f0566b;
  --accent-dark: #ff8090;
  --accent-soft: #3a1419;
  --on-accent: #121214;
  --header: #0b0b0d;
  --header-text: #e6e6ea;
  --header-line: #2c2c32;
  --shadow: none;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
header.top :focus-visible { outline-color: #fff; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Header */
header.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--header);
  background: color-mix(in srgb, var(--header) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--header-line);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-weight: 650; color: #fff; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
nav a { color: var(--header-text); text-decoration: none; font-size: 15px; }
nav a:hover { color: #fff; text-decoration: underline; }
.top-right { display: flex; align-items: center; gap: 16px; }
@media (max-width: 640px) { nav ul { gap: 14px; } nav li.opt { display: none; } .top-right { gap: 12px; } }
@media (max-width: 380px) {
  header.top .wrap { padding: 0 14px; gap: 10px; }
  .brand { font-size: 16px; }
  nav ul { gap: 12px; }
  nav a { font-size: 14px; }
  .top-right { gap: 10px; }
}
@media (max-width: 350px) { nav li.opt-xs { display: none; } }

/* Theme toggle */
.theme-toggle {
  flex: none; display: inline-grid; place-items: center;
  width: 38px; height: 38px; padding: 0; margin-right: -4px;
  background: transparent; color: var(--header-text);
  border: 1px solid rgb(255 255 255 / .2); border-radius: 8px; cursor: pointer;
  transition: color .15s, border-color .15s, background-color .15s;
}
.theme-toggle:hover { color: #fff; border-color: rgb(255 255 255 / .45); background: rgb(255 255 255 / .1); }
.theme-toggle svg { width: 18px; height: 18px; }
/* Show the moon in light mode (click for dark) and the sun in dark mode (click for light). */
.theme-toggle .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }

/* Hero */
.hero { padding: 88px 0 72px; }
.eyebrow { font: 500 14px/1 var(--mono); color: var(--accent); margin: 0 0 20px; letter-spacing: .02em; }
.hero h1 {
  font: 600 clamp(38px, 6vw, 60px)/1.08 var(--serif);
  letter-spacing: -.02em; margin: 0 0 24px; max-width: 16ch;
}
.hero p.lede { font-size: 20px; color: var(--text-2); max-width: 60ch; margin: 0 0 16px; }
.hero p { color: var(--text-2); max-width: 60ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 32px; padding: 0; list-style: none; }
.chips li { font: 13px/1 var(--mono); padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 11px 18px; border-radius: 8px; font-weight: 550; font-size: 15px;
  text-decoration: none; border: 1px solid var(--accent);
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }
.btn.ghost { color: var(--accent); }

/* Sections */
section { padding: 64px 0; border-top: 1px solid var(--line); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
h2 { font: 600 30px/1.2 var(--serif); letter-spacing: -.01em; margin: 0; }
.sec-head p { margin: 0; color: var(--muted); max-width: 52ch; }
h3 { font-size: 18px; line-height: 1.3; margin: 0 0 6px; }
h3 a { color: var(--text); text-decoration: none; }
h3 a:hover { color: var(--accent); }
.meta { font: 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }

/* Domain cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); list-style: none; margin: 0; padding: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; position: relative;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
.card p { margin: 0; color: var(--text-2); font-size: 15.5px; }
.card .domain { font: 14px/1 var(--mono); color: var(--accent); margin-top: auto; padding-top: 16px; }
.card a.stretch::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }

/* Work cards with screenshots */
.work .card { padding: 0; overflow: hidden; }
.work .shot { aspect-ratio: 4 / 3; background: var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.work .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.work .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }

/* Code list */
.code-groups { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.code-groups h3 { font: 600 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.code-groups ul { list-style: none; margin: 0; padding: 0; }
.code-groups li { padding: 14px 0; border-top: 1px solid var(--line); }
.code-groups li a { font-weight: 600; text-decoration: none; }
.code-groups li a:hover { text-decoration: underline; }
.code-groups li p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }

/* Tools */
.tools { display: grid; gap: 10px 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); list-style: none; margin: 0; padding: 0; }
.tools li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--text-2); }
.tools a { font-weight: 600; text-decoration: none; display: block; }

/* Contact */
.contact { display: grid; gap: 32px; grid-template-columns: 1.2fr 1fr; align-items: start; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }
.contact p { color: var(--text-2); margin: 12px 0 0; max-width: 52ch; }
.social { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.social a {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 550;
}
.social a:hover { border-color: var(--accent); }
.social img { width: 32px; height: 32px; border-radius: 6px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
footer a { color: var(--muted); }

/* Website pages (websites/*.html) */
.crumb { margin: 40px 0 0; font-size: 15px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.project { display: grid; gap: 56px; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; padding: 28px 0 72px; }
@media (max-width: 820px) { .project { grid-template-columns: 1fr; gap: 40px; } }
.project h1 { font: 600 clamp(32px, 5vw, 46px)/1.1 var(--serif); letter-spacing: -.02em; margin: 0 0 22px; overflow-wrap: anywhere; }
.project .content p, .project .content li { color: var(--text-2); max-width: 62ch; }
.project .content ul { padding-left: 1.2em; margin: 0 0 16px; }
.project .content li + li { margin-top: 6px; }
.project .actions { margin: 28px 0 36px; }
.screenshot { margin: 0; }
.screenshot img { height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); background: var(--surface); }
.screenshot figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; }
.more h2 { font: 600 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.more ul { list-style: none; margin: 0 0 26px; padding: 0; }
.more li { border-top: 1px solid var(--line); }
.more a { display: block; padding: 9px 0; text-decoration: none; font-weight: 550; font-size: 15px; overflow-wrap: anywhere; }
.more a:hover { text-decoration: underline; }
.more a[aria-current="page"] { color: var(--text); }

/* Header: drop the "Latest" link where the nav runs out of room */
@media (max-width: 760px) { nav li.opt-md { display: none; } }

/* Latest developments: one wide feature card, screenshot beside the text */
.feature { list-style: none; margin: 0; padding: 0; }
.feature .card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); padding: 0; overflow: hidden; }
.feature .shot { aspect-ratio: 4 / 3; background: var(--line); border-right: 1px solid var(--line); overflow: hidden; }
.feature .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.feature .body { padding: 32px; display: flex; flex-direction: column; justify-content: center; }
.feature h3 { font: 600 clamp(24px, 3vw, 30px)/1.2 var(--serif); letter-spacing: -.01em; margin: 0 0 12px; overflow-wrap: anywhere; }
.feature .body p { font-size: 16.5px; }
.feature .go { margin-top: 20px; font-weight: 600; font-size: 15px; color: var(--accent); }
.feature .card:hover .go { color: var(--accent-dark); }
@media (max-width: 720px) {
  .feature .card { grid-template-columns: 1fr; }
  .feature .shot { border-right: 0; border-bottom: 1px solid var(--line); }
  .feature .body { padding: 22px 20px 24px; }
}
