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

: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;

  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, "SFMono-Regular",
               Consolas, "Liberation Mono", monospace;

  --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;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

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-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.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; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 12px;
  opacity: 0.7;
}

/* 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.1rem, 6.2vw, 3.7rem);
  max-width: 18ch;
  margin-bottom: 24px;
}

.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 ---------- */

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.project {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px 24px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.project::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(to right, var(--accent), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.project:hover::after { opacity: 0.8; }

.project-index {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 6px 0 0;
}

.project-body { min-width: 0; }

.project-title {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  margin-bottom: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 18px;
}
.status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status-build .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.15); }
.status-live  .dot { background: var(--live);   box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15); }
.status-early .dot { background: var(--early); }

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tags li {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
}

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

.link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 211, 252, 0.35);
  padding-bottom: 1px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.link:hover {
  color: #bde9ff;
  border-bottom-color: currentColor;
}

/* ---------- 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-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.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-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  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) {
  .project { grid-template-columns: 1fr; gap: 0; }
  .project-index { margin-bottom: 10px; }
  .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;
  }
}
