/* Palette taken from the Knitted Cats logo + Night Shift Hospital key art */
:root {
  --bg: #161414;
  --bg-2: #211e1d;
  --cream: #efe6d4;
  --cream-dim: #b9b0a2;
  --amber: #e8a317;       /* cat eyes */
  --amber-dark: #b37b08;
  --pink: #e9a3b3;        /* cat ears */
  --lilac: #b9a6e8;
  --grey: #a3a3a3;        /* cat wool */
  --navy: #1b1f5c;        /* NSH night sky */
  --navy-2: #252a72;
  --teal: #43d0cf;        /* NSH emblem */
  --teal-dark: #23a09f;
  --green: #63c48c;
  --red: #ec5a4f;
  --radius: 24px;
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --font: "Nunito", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 66px; } /* land below the sticky header */
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font: 400 18px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-weight: 900; line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 6vw, 4.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
p { margin: 0 0 1em; }
a { color: inherit; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.eyebrow {
  display: inline-block;
  font-weight: 900; font-size: .78rem; line-height: 1;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.1rem;
}
.eyebrow-teal { color: var(--teal); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px max(16px, calc((100% - 1120px) / 2)) 12px;
  background: rgba(22, 20, 20, .86);
  backdrop-filter: blur(10px);
  border-bottom: 2px dashed rgba(239, 230, 212, .12);
}
.brand { display: flex; align-items: baseline; /* cat sits on the text baseline */ gap: 10px; text-decoration: none; font-weight: 900; font-size: 1.25rem; letter-spacing: -.01em; }
.brand img { width: 52px; height: auto; transition: transform .35s var(--spring); }
@media (hover: hover) { .brand:hover img { transform: translateY(-3px); } }
.nav { display: flex; align-items: center; gap: 24px; font-weight: 800; }
.nav a { text-decoration: none; position: relative; color: var(--cream-dim); transition: color .2s; }
.nav a:hover { color: var(--cream); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 6px, transparent 6px 10px);
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav a:hover::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 26px; border-radius: 999px;
  font: 900 1rem var(--font); text-decoration: none;
  outline-offset: -7px;
  transition: transform .15s;
}
@media (hover: hover) { .btn:hover { transform: translateY(-2px); } }
.btn-amber { background: var(--amber); color: var(--bg); box-shadow: 0 4px 0 var(--amber-dark); outline: 2px dashed rgba(22,20,20,.35); }
.btn-teal  { background: var(--teal); color: var(--navy); box-shadow: 0 4px 0 var(--teal-dark); outline: 2px dashed rgba(27,31,92,.35); }
.btn-dark  { background: var(--bg); color: var(--cream); box-shadow: 0 4px 0 #000; outline: 2px dashed rgba(239,230,212,.3); }
.btn-ghost { border: 2px solid rgba(239,230,212,.35); }
.btn-ghost:hover { border-color: var(--cream); }

/* ---------- Hero ---------- */
.hero {
  position: relative; text-align: center; overflow: hidden;
  padding: clamp(56px, 10vw, 120px) 0 0;
  background: radial-gradient(700px 380px at 50% 100%, rgba(232,163,23,.10), transparent 70%);
}
.hero-inner { max-width: 860px; }
.lead { font-size: 1.18rem; color: var(--cream-dim); max-width: 34em; margin-inline: auto; }
.hero .cta-row { justify-content: center; }

/* The mascot "peeks" over the edge below it: its flat bottom sits on the edge */
/* The wrapper stays put and catches the hover, so the rising cat never slips out from under the cursor */
.peek { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; transition: transform .35s var(--spring); }
.peek-hero { width: min(460px, 78vw); margin: clamp(40px, 7vw, 72px) auto 0; }
.peek-hero .peek { animation: peek 1s .2s cubic-bezier(.2,.9,.3,1.2) backwards; }
@media (hover: hover) {
  .peek-hero:hover .peek,
  .peek-contact:hover .peek { transform: translateY(-10px); }
}
@keyframes peek { from { transform: translateY(100%); } to { transform: none; } }

/* Everything that's "sewn on" at an angle reacts the same way on hover.
   Scaling up (not shifting) keeps the cursor inside, so there's no flicker at the edges. */
.tilt { transform: rotate(var(--tilt, 0deg)); transition: transform .35s var(--spring); }
@media (hover: hover) { .tilt:hover { transform: rotate(0deg) scale(1.03); } }

/* Knitted band: rows of V-stitches in cat-grey */
.knit-band {
  height: 36px;
  background-color: #8e8e8e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.22' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M3 2q2.5 8 6 14'/%3E%3Cpath d='M15 2q-2.5 8-6 14'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.18' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M3 3q2.5 8 6 14'/%3E%3Cpath d='M15 3q-2.5 8-6 14'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 18px 18px;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.25), inset 0 -3px 0 rgba(0,0,0,.25);
}

/* ---------- Night Shift Hospital ---------- */
.night {
  position: relative; overflow: hidden;
  background: radial-gradient(1100px 520px at 80% 0%, var(--navy-2), transparent 65%), var(--navy);
  color: #dfe2ff;
  padding: clamp(60px, 9vw, 110px) 0;
}
.stars {
  position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image:
    linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-size: 4px 4px;
  background-repeat: no-repeat;
  background-position: 8% 12%, 28% 6%, 47% 18%, 66% 9%, 88% 15%, 95% 4%;
}
.night .wrap { position: relative; }
.nsh-head { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.nsh-title {
  font-size: clamp(2.8rem, 7vw, 5.2rem); color: #fff;
  text-transform: uppercase; line-height: .92; letter-spacing: -.02em;
  text-shadow: 0 0 30px rgba(67,208,207,.35);
}
.nsh-tag { font-size: 1.2rem; color: #fff; }
.nsh-joke { color: rgba(223,226,255,.7); margin: 0; }
.night .cta-row { align-items: center; gap: 22px; }
.publisher {
  display: flex; align-items: center; gap: 12px;
  padding-left: 22px; border-left: 2px dashed rgba(223,226,255,.2);
  font-size: .85rem; color: rgba(223,226,255,.7);
}

/* Key art with an embroidered wishlist patch sewn onto its corner */
.nsh-media { position: relative; }
.wl-patch {
  position: absolute; top: -46px; left: -40px; margin: 0;
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding-top: 20px; /* nudge the text block down: the bold number reads as sitting high */
  background: var(--teal); color: var(--navy);
  outline: 2px dashed rgba(27,31,92,.45); outline-offset: -9px;
  box-shadow: 0 0 0 4px var(--teal-dark), 0 14px 30px rgba(0,0,0,.4);
  --tilt: -12deg;
}
.wl-patch b { font-weight: 900; font-size: 1.7rem; line-height: 1; letter-spacing: -.02em; }
.wl-patch span { font-weight: 800; font-size: .78rem; line-height: 1.15; margin-top: 4px; max-width: 8em; }
.publisher img { width: 104px; transition: transform .2s; }
@media (hover: hover) { .publisher a:hover img { transform: scale(1.05); } }

.keyart {
  margin: 0; border-radius: var(--radius); overflow: hidden; position: relative;
  box-shadow: 0 30px 70px rgba(0,0,0,.45);
  --tilt: 1.2deg;
}
.keyart::after {
  content: ""; position: absolute; inset: 10px; border-radius: 16px;
  border: 2px dashed rgba(255,255,255,.45); pointer-events: none;
}

.triage { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; margin-top: clamp(64px, 9vw, 100px); }
.triage h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); color: #fff; }
.triage p { font-size: 1.08rem; }

.chart {
  background: #fbf6ec; color: #2a2433; border-radius: 18px; padding: 18px 20px 8px;
  font-size: .95rem; line-height: 1.45;
  box-shadow: 0 18px 0 rgba(0,0,0,.2);
  --tilt: -1.5deg;
  outline: 2px dashed rgba(42,36,51,.18); outline-offset: -8px;
}
.chart p { margin-bottom: .55em; }
.ecg-row { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: .72rem; letter-spacing: .1em; color: #8a8295; margin-bottom: 8px; }
.ecg { flex: 1; height: 34px; }
.ecg path {
  fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 500; animation: pulse 2.8s linear infinite;
}
@keyframes pulse { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
.chart-label { font-weight: 900; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: #8a8295; }
.chart-name { font-weight: 900; font-size: 1.35rem; }
.chart-triage { font-weight: 900; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); display: inline-block; }

/* ---------- Embroidered patch card ---------- */
.patch {
  position: relative;
  background: var(--bg-2); border-radius: var(--radius);
  outline: 2px dashed rgba(232,163,23,.7); outline-offset: -11px;
  box-shadow: 0 0 0 5px var(--bg-2), 0 0 0 7px rgba(239,230,212,.08);
}
.patch-cream {
  background: var(--cream); color: var(--bg);
  outline-color: rgba(22,20,20,.3);
  box-shadow: 0 0 0 5px var(--cream), 0 0 0 7px rgba(239,230,212,.25);
}

/* ---------- Studio ---------- */
.studio { padding: clamp(60px, 9vw, 110px) 0 40px; }
.studio-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center; }
.studio p { color: var(--cream-dim); }
.stitch-list { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 12px; font-weight: 800; }
.stitch-list li { display: flex; gap: 12px; align-items: center; }
.stitch-list li::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px dashed var(--pink);
  background: radial-gradient(circle, var(--pink) 0 4px, transparent 5px);
}
.location { padding: 38px 34px; --tilt: -1.5deg; }
.location-city { font-weight: 900; font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.1; color: var(--cream); }
.location-note { margin: 0; }

/* ---------- Team ---------- */
.team { padding: 70px 0; }
.people { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; margin-top: 1.8rem; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; font-size: .9rem; color: var(--cream-dim); }
.person i {
  --c: var(--amber);
  display: grid; place-items: center;
  width: 84px; height: 84px; border-radius: 50%; margin-bottom: 10px;
  font-style: normal; font-weight: 900; font-size: 1.3rem; color: var(--bg);
  line-height: 1; letter-spacing: .02em;
  text-box: trim-both cap alphabetic; /* center the capitals themselves, not the line box */
  background: var(--c);
  outline: 2px dashed rgba(22,20,20,.4); outline-offset: -8px;
  transition: transform .35s var(--spring);
}
@media (hover: hover) { .person:hover i { transform: rotate(-10deg) scale(1.06); } }
.person b { color: var(--cream); font-size: 1rem; }

/* ---------- Contact ---------- */
.contact { padding: 120px 0 100px; }
.contact-box { padding: clamp(40px, 6vw, 64px) 24px; text-align: center; max-width: 760px; margin-inline: auto; }
.contact-box p { color: #5a524a; }
.mail-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: .4rem; }
.contact-box .btn { word-break: break-all; }
.btn-copy {
  cursor: pointer; border: 2px solid rgba(22,20,20,.35); background: transparent; color: var(--bg);
  min-width: 7.5em;
}
.btn-copy:hover { border-color: var(--bg); }
.btn-copy.is-copied { background: var(--teal); border-color: var(--teal); }
.peek-contact {
  position: absolute; left: 50%; bottom: 100%;
  width: 220px; transform: translateX(-50%);
  margin-bottom: 7px;
}

/* ---------- Footer ---------- */
.foot { border-top: 2px dashed rgba(239,230,212,.12); padding: 24px 0; font-size: .9rem; color: var(--cream-dim); }
.foot-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .nsh-head, .triage, .studio-grid { grid-template-columns: 1fr; }
  .people { grid-template-columns: repeat(3, 1fr); }
  .keyart, .chart { --tilt: 0deg; }
  .nsh-media { margin-top: 36px; }
  .wl-patch { left: auto; right: -6px; --tilt: 10deg; }
}
/* Menu button only exists on phones */
.menu-btn {
  display: none;
  font: 900 .8rem var(--font); letter-spacing: .06em; cursor: pointer;
  color: var(--cream); background: transparent;
  border: 2px dashed rgba(239,230,212,.45); border-radius: 999px; padding: 7px 16px;
}
.top.is-open .menu-btn { border-color: var(--amber); color: var(--amber); }

@media (max-width: 600px) {
  body { font-size: 17px; }
  .menu-btn { display: inline-flex; }
  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 6px 16px 14px;
    background: var(--bg);
    border-bottom: 2px dashed rgba(239,230,212,.12);
  }
  .top.is-open .nav { display: flex; }
  .nav a { padding: 12px 0; font-size: 1.1rem; color: var(--cream); }
  .nav a + a { border-top: 1px dashed rgba(239,230,212,.12); }
  .nav a::after { display: none; }
  .people { grid-template-columns: repeat(2, 1fr); }
  .peek-contact { width: 170px; }
  .publisher { padding-left: 0; border-left: 0; }
  .wl-patch { width: 120px; height: 120px; top: -40px; padding-top: 16px; }
  .wl-patch b { font-size: 1.35rem; }
  .wl-patch span { font-size: .68rem; }
}

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