/*
 * Smurphilicious — site styles.
 * Values follow the design handoff (README.md at the repo root) and the
 * prototype in design/. Mobile first; the hero switches to three columns at 1040px.
 */

/* ---------- Fonts (self-hosted from Google Fonts, SIL OFL 1.1 — see fonts/OFL-*.txt) ---------- */

@font-face {
  font-family: "Marcellus";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/marcellus-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Marcellus";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/marcellus-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Instrument Sans upright is a variable font (wght 400–700); the page uses 400, 500 and 600. */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-sans-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  --ground-top: #0A0B12;
  --ground-mid: #0E0E14;
  --ground-bottom: #15120F;
  --bar: #0A0908;
  --bar-border: #2A2219;

  --text: #EAE4D8;
  --text-secondary: #B3AA9A;
  --text-definition: #D9D2C4;
  --text-muted: #8E8576;
  --text-mono: #9C8F78;

  --gold: #B8902A;
  --gold-hover: #D4AE4E;
  --gold-rule: #4A3B1C;
  --gold-border: #5C4A1E;

  --surface: rgba(16, 14, 12, .82);
  --surface-blur: blur(6px);
  --thumb: #1E1915;
  --input: #0F0D0B;

  --border: #2E271E;
  --border-list: #3A3020;
  --border-input: #3A3328;

  --red: #B3302A;
  --red-hover: #C23A33;
  --red-active: #9A2823;
  --error: #E08A6E;

  --font-display: Marcellus, Georgia, serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --container: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-pad: clamp(40px, 7vw, 72px);
}

/* ---------- Base ---------- */

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

html {
  background: #0B0C12;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
  background: linear-gradient(180deg, var(--ground-top) 0%, var(--ground-mid) 45%, var(--ground-bottom) 100%);
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  color: var(--gold-hover);
}

::selection {
  background: var(--gold);
  color: #15120F;
}

input,
textarea,
button {
  font: inherit;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Star sky (drawn by js/sky.js) ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  opacity: 0;
  transition: opacity .8s ease;
}

.sky canvas.is-ready {
  opacity: 1;
}

.page {
  position: relative;
  z-index: 1;
  overflow-x: clip;
}

/* ---------- Nav ---------- */

.nav {
  background: var(--bar);
  border-bottom: 1px solid var(--bar-border);
}

.nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px var(--gutter);
}

.brand,
.brand:hover {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand img {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .02em;
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-size: 16px;
}

.nav__links a {
  padding: 6px 0;
  color: var(--text);
}

.nav__links a:hover {
  color: var(--gold);
}

/* ---------- Hero ---------- */

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--section-pad) var(--gutter) clamp(64px, 10vw, 112px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  margin-top: 48px;
}

.hero__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__side--left {
  order: 1;
}

.hero__side--right {
  order: 2;
}

.hero__bust {
  order: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 5.6vw, 80px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--text);
}

.hero__copy {
  max-width: 30ch;
  margin: 18px 0 0;
  font-size: 18px;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* Two masks intersected so the bust fades out at the sides and bottom. Approved by the owner — keep exactly. */
.hero__img {
  position: relative;
  display: block;
  width: clamp(280px, 36vw, 480px);
  max-width: 100%;
  height: auto;
  -webkit-mask-image:
    linear-gradient(to bottom, #000 55%, rgba(0, 0, 0, .6) 75%, transparent 97%),
    linear-gradient(to right, transparent 0%, rgba(0, 0, 0, .35) 9%, rgba(0, 0, 0, .8) 18%, #000 27%, #000 82%, rgba(0, 0, 0, .6) 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, #000 55%, rgba(0, 0, 0, .6) 75%, transparent 97%),
    linear-gradient(to right, transparent 0%, rgba(0, 0, 0, .35) 9%, rgba(0, 0, 0, .8) 18%, #000 27%, #000 82%, rgba(0, 0, 0, .6) 92%, transparent 100%);
  mask-composite: intersect;
}

@media (min-width: 1040px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 48px;
    margin-top: 64px;
  }

  .hero__side--left {
    order: 0;
    align-items: flex-end;
    text-align: right;
  }

  .hero__bust {
    order: 1;
  }

  .hero__side--right {
    align-items: flex-start;
    text-align: left;
  }
}

/* Dictionary entry */

.entry-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(32px, 5vw, 48px);
}

.entry {
  width: 100%;
  max-width: 600px;
  margin: 0;
  padding: 20px 26px;
  border: 1px solid var(--gold-border);
  background: rgba(10, 9, 8, .7);
}

.entry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gold-border);
}

.entry__word {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text);
}

.entry__pron {
  color: var(--text-secondary);
  white-space: nowrap;
}

.entry__pos {
  font-style: italic;
  color: var(--text-secondary);
}

.entry__def {
  margin: 0;
  color: var(--text-definition);
  text-wrap: pretty;
}

.entry__note {
  color: var(--text-secondary);
}

/* ---------- Sections ---------- */

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--section-pad) var(--gutter);
  scroll-margin-top: 16px;
}

.section--contact {
  padding-bottom: clamp(64px, 10vw, 104px);
}

/* Section label: a gold rule on each side of a small uppercase heading. */
.section-label {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 0 40px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold);
}

.section-label::before,
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gold-rule);
}

/* Shared surface for tiles and panels */
.tile,
.panel {
  background: var(--surface);
  -webkit-backdrop-filter: var(--surface-blur);
  backdrop-filter: var(--surface-blur);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.panel {
  display: grid;
  padding: clamp(24px, 4vw, 40px);
}

.lede {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 28px);
  line-height: 1.35;
}

/* ---------- Work ---------- */

.work-group {
  margin-bottom: 48px;
}

.work-group__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  min-width: 0;
  padding: 10px;
  transition: border-color .2s, transform .2s;
}

.tile:hover {
  border-color: var(--gold-border);
  transform: translateY(-2px);
}

/* Empty state: shown until a video exists for the tile. */
.tile__thumb {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 16 / 9;
  padding: 14px 16px;
  background: var(--thumb);
  border-radius: 2px;
}

.tile__status {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mono);
}

.tile__thumb-title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.2;
  color: var(--gold);
}

/* A workflow's canvas, as built, in place of the empty state. The video replaces it later (see SITE.md). */
.tile__thumb--shot {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.tile__thumb--shot picture,
.tile__thumb--shot img {
  display: block;
  width: 100%;
  height: 100%;
}

.tile__thumb--shot img {
  object-fit: contain;
}

.tile__thumb--shot .tile__status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  background: rgba(10, 9, 8, .78);
  border-radius: 2px;
}

/* The three invented clients the workflows are shown for. */
.clients {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--text-secondary);
}

.clients__name {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}

.clients__note {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--text-mono);
}

/* Video state: a lazy-loaded YouTube or Vimeo iframe in place of .tile__thumb (see SITE.md). */
.tile__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--thumb);
  border-radius: 2px;
}

.tile__media iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.tile__body {
  padding: 16px 12px 10px;
}

.tile__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}

.tile__caption {
  display: -webkit-box;
  min-height: 3em;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* ---------- Background ---------- */

.panel--background {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 28px 56px;
}

.panel--background .lede {
  max-width: 24ch;
  text-wrap: pretty;
}

.skills {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills li {
  padding: 12px 0;
  border-top: 1px solid var(--border-list);
}

.skills li:last-child {
  border-bottom: 1px solid var(--border-list);
}

/* ---------- Contact ---------- */

.panel--contact {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 32px 56px;
}

.panel--contact .lede {
  margin-bottom: 20px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-links a {
  width: fit-content;
}

.contact-links a[href^="tel:"] {
  white-space: nowrap;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border-input);
  border-radius: 3px;
  outline: none;
}

.field input {
  min-height: 48px;
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
}

/* Keep browser autofill on the dark input colours. */
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--input) inset;
}

.field__error,
.form__status {
  margin: 0;
  font-size: 14px;
  color: var(--error);
}

.field__error:empty,
.form__status:empty {
  display: none;
}

/* Honeypot: hidden from people, left in the form for bots. */
.form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button {
  align-self: flex-start;
  min-height: 48px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text);
  background: var(--red);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.button:hover {
  background: var(--red-hover);
}

.button:active {
  background: var(--red-active);
}

.button:disabled {
  background: var(--red);
  cursor: progress;
}

/* Success message, shown in place of the form. */
.sent {
  padding-top: 24px;
  border-top: 1px solid var(--gold);
}

.sent__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
}

.sent__title:focus {
  outline: none;
}

.sent__body {
  margin: 0 0 20px;
  color: var(--text-secondary);
}

.link-button {
  padding: 0;
  color: var(--gold);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--gold);
  cursor: pointer;
}

.link-button:hover {
  color: var(--gold-hover);
  border-bottom-color: var(--gold-hover);
}

/* ---------- Footer ---------- */

.footer {
  position: relative;
  background: var(--bar);
  border-top: 1px solid var(--bar-border);
}

/* Back-to-top: a half-circle tab sitting on the footer's top edge. */
.to-top {
  position: absolute;
  top: -36px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 36px;
  padding: 6px 0 0;
  background: var(--bar);
  border: 1px solid var(--bar-border);
  border-bottom: 0;
  border-radius: 72px 72px 0 0;
  cursor: pointer;
  transform: translateX(-50%);
}

.to-top:hover {
  border-color: var(--gold-border);
}

.to-top__chevron {
  display: block;
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-top: 1.5px solid var(--gold);
  border-left: 1.5px solid var(--gold);
  transform: rotate(45deg);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px var(--gutter);
}

.footer__copy {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .sky canvas {
    transition: none;
  }
}
