/* Black Salamander Studios
   Dark / cold / arcane. One stylesheet, no build step, no external requests. */

/* Newsreader, SIL OFL 1.1, self-hosted and subset by tools/make_fonts.py.
   One variable file covers every weight we use. It is a serif with a
   calligraphic hand, chosen to answer the brush-drawn salamander in the mark;
   nothing else on the page should compete with it. */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:          #0a0e17;
  --bg-alt:      #0c121d;
  --surface:     #111826;
  --surface-2:   #141d2e;
  --line:        rgba(148, 176, 214, 0.14);
  --line-strong: rgba(148, 176, 214, 0.28);

  --text:        #e7eefb;
  --text-dim:    #a6b6d0;
  --text-faint:  #7386a3;

  --accent:      #7dd3fc;
  --accent-deep: #38bdf8;
  --violet:      #a78bfa;
  --live:        #5eead4;
  --early:       #94a3b8;

  /* Display carries the personality, body stays quiet and gets out of the way.
     There is no monospace: this site has no code and no data on it, and a mono
     face on small labels only ever signalled "technical product". */
  --font-display: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;

  --wrap: 1080px;
  --gutter: 20px;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  /* a serif this size needs no negative tracking; it is already tightly fitted */
  letter-spacing: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #05080f;
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.78);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

/* The studio mark, keyed out of the ink-on-parchment original and tinted bone.
   The source is 100px, so it is only ever scaled down. See tools/make_mark.py. */
.mark {
  width: 38px;
  height: 38px;
  flex: none;
  opacity: 0.92;
  transition: opacity 0.18s ease;
}
.brand:hover .mark { opacity: 1; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}
/* Tracked-out all-caps, as the lockup was originally. This is a wordmark, not
   a label above content, so the treatment earns its place here in a way it did
   not above every heading. Set in the body sans rather than the monospace it
   first used, since there is no longer a mono face on the site. */
.brand-sub {
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-faint);
  /* the tracking adds a trailing gap; pull it back so the sub sits flush
     under the B of the name above it */
  margin-right: -0.34em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.nav a:hover {
  color: var(--text);
  background: rgba(125, 211, 252, 0.08);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(72px, 13vw, 140px) 0 clamp(64px, 10vw, 112px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto -10%;
  height: 120%;
  background:
    radial-gradient(60% 55% at 22% 18%, rgba(56, 189, 248, 0.16), transparent 68%),
    radial-gradient(48% 48% at 78% 8%, rgba(167, 139, 250, 0.12), transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 108px 100%;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, transparent, #000 35%, transparent 92%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, transparent 92%);
  pointer-events: none;
}

/* Keeps the wrap's 1080px measure so the hero lines up with the header brand
   and the section headings below. The text itself is constrained per element. */
.hero-inner { position: relative; }

/* The measure is set so the headline breaks on its comma rather than stranding
   the last word on a line of its own. */
.hero h1 {
  font-size: clamp(2.2rem, 6.4vw, 3.9rem);
  /* The serif sets narrower than the old sans, so a fixed measure no longer
     lands the break on the comma. Let the browser even the lines instead. */
  max-width: 24ch;
  text-wrap: balance;
  margin-bottom: 26px;
}

.lede {
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  color: var(--text-dim);
  max-width: 62ch;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease,
              color 0.18s ease, transform 0.18s ease;
}
.btn:hover {
  border-color: var(--accent);
  background: rgba(125, 211, 252, 0.08);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04121c;
  font-weight: 600;
}
.btn-primary:hover {
  background: #a5e3ff;
  border-color: #a5e3ff;
  color: #04121c;
}

/* ---------- sections ---------- */

.section { padding: clamp(64px, 10vw, 110px) 0; }
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.section-head { margin-bottom: clamp(36px, 6vw, 56px); }
.section-head h2 {
  font-size: clamp(1.55rem, 3.6vw, 2.2rem);
  margin-bottom: 10px;
}
.section-note {
  color: var(--text-faint);
  font-size: 0.98rem;
}

/* ---------- projects ----------
   Each project gets a different shape on purpose. The lead project carries a
   grid of development shots, the live one a wide lead image, and the
   unannounced one nothing at all, which reads as restraint rather than a gap. */

.project {
  padding: clamp(36px, 6vw, 60px) 0;
  border-bottom: 1px solid var(--line);
}
.project:first-of-type { padding-top: 0; }
.project:last-of-type { border-bottom: 0; }

.project-title {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin-bottom: 10px;
}

/* One plain line, sentence case, no dots strung together and no small caps. */
.project-note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.97rem;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.project-copy {
  color: var(--text-dim);
  max-width: 68ch;
  margin-bottom: 0;
}

.project-links { margin-top: 20px; }

.project-quiet .project-copy { color: var(--text-faint); max-width: 54ch; }

/* ---------- screenshots ---------- */

.shots { margin: 26px 0 0; }

.shot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.shot-caption {
  margin: 8px 0 0;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--text-faint);
}

.shots figcaption {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text-faint);
  max-width: 64ch;
}

.shot-lead {
  margin: 0 0 26px;
}
.shot-lead img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.shot-lead figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.project .shot-grid-3 { margin-top: 26px; }

/* These three come from different aspect ratios, so left alone their bottom
   edges and captions sit at different heights. The 2-up grid above does not
   need this: its rows are already near-identical shapes. */
.shot-grid-3 .shot img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

@media (min-width: 760px) {
  .shot-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .shot-grid-3 { grid-template-columns: repeat(3, 1fr); }
}


/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.about-lead {
  font-size: clamp(1.1rem, 2.6vw, 1.35rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.about-rest { color: var(--text-dim); }

/* ---------- contact ---------- */

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.contact-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.contact-list li:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.contact-list .link {
  font-size: 1.06rem;
}
.contact-note {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--text-faint);
}

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  background: var(--bg-alt);
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}
.foot-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-dim);
}
.foot-legal {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- larger screens ---------- */

@media (min-width: 720px) {
  :root { --gutter: 32px; }

  .project {
    grid-template-columns: 96px 1fr;
    padding: 42px 0;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .contact-list { grid-template-columns: 1fr 1fr; }
}

/* Narrow phones. The header is one row of brand + three links, which only fits
   if the wordmark stops wrapping and everything tightens up. */
@media (max-width: 560px) {
  :root { --gutter: 16px; }

  .head-inner { gap: 8px; min-height: 60px; }

  .brand { gap: 9px; min-width: 0; }
  .mark { width: 28px; height: 28px; }
  .brand-text { overflow: hidden; }
  .brand-name {
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .brand-sub { display: none; }

  .nav { flex: none; }
  .nav a {
    padding: 6px 7px;
    font-size: 0.78rem;
    white-space: nowrap;
  }
}

/* 360px class devices: squeeze the header a little further so the wordmark
   is not clipped by the nav. */
@media (max-width: 400px) {
  :root { --gutter: 12px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 0.76rem; }
  .nav a { padding: 6px 6px; font-size: 0.74rem; }
}

@media (max-width: 480px) {
  .foot-inner { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
