/* swazee.net — broadside splash. Colors, type, and measure baked from design handoff. */

:root {
  --bg: #0F0D0B;
  --plate: #1A1714;
  --fg: #F5ECD8;
  --muted: #8A7F6A;
  --rule: rgba(245, 236, 216, 0.18);
  --accent: #E8A23B;

  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', Georgia, serif;

  --container: 1320px;
  --pad-x: 40px;
  --pad-section: 80px;
  --pad-hero: 56px;
  --gap: 40px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232, 162, 59, 0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232, 162, 59, 0.5); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ---- Film grain overlay (retro medium). ---- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: screen;
  opacity: 0.8;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---- Logo flicker keyframes (one-shot on mount). ---- */
@keyframes sw-flicker {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
  6%       { filter: brightness(1.25) drop-shadow(0 0 14px rgba(232, 162, 59, 0.5)); }
  9%       { filter: brightness(0.82); }
  12%      { filter: brightness(1.18) drop-shadow(0 0 18px rgba(232, 162, 59, 0.6)); }
  15%      { filter: brightness(0.95); }
  48%, 52% { filter: brightness(1.12) drop-shadow(0 0 10px rgba(232, 162, 59, 0.35)); }
}
.sw-flicker { animation: sw-flicker 5.5s ease-in-out 1 both; }

/* ---- Typography primitives. ---- */
.kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
}
.kicker--heavy { letter-spacing: 0.35em; }
.kicker--wide { letter-spacing: 0.4em; font-size: 11px; margin-top: 16px; }

.center { text-align: center; }

.display {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 64px;
  margin: 0 0 28px;
  letter-spacing: -0.03em;
}
.display--center {
  text-align: center;
  font-size: clamp(56px, 8vw, 112px);
  text-wrap: balance;
  line-height: 1;
  margin: 0;
}
.display__italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.italic-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 36px;
}

.lede-intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 520px;
}

/* ---- Ruling lines on masthead. ---- */
.rule-2 { height: 2px; background: var(--fg); }
.rule-1 { height: 1px; background: var(--fg); }
.rule-2-gap { height: 3px; }

/* ---- Sticky compact nav. ---- */
.nav-compact {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0F0D0BEE;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  transition: transform 400ms ease, border-color 300ms ease;
}
.nav-compact.is-visible {
  transform: translateY(0);
  border-bottom-color: var(--rule);
}
.nav-compact__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-compact__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.nav-compact__links {
  display: flex;
  gap: 26px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-compact__links a {
  text-decoration: none;
  color: inherit;
  padding: 4px 0;
}
.nav-compact__links a:hover { color: var(--fg); }

.cmd-button {
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
  cursor: pointer;
  letter-spacing: 0.15em;
}
.cmd-button:hover { color: var(--fg); border-color: var(--fg); }

/* ---- Crest (SVG hero / nav). ---- */
.crest { color: var(--accent); display: inline-block; line-height: 0; }
.crest svg { display: block; }
.crest__mono { color: var(--bg); }
.crest--hero { filter: drop-shadow(0 0 22px rgba(232, 162, 59, 0.5)); }

.wordmark {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.18em;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.wordmark--small { font-size: 12px; gap: 4px; }
.wordmark__net {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.38em;
  letter-spacing: 0.1em;
  opacity: 0.55;
  transform: translateY(-0.1em);
  margin-left: 0.35em;
}

/* ---- Sections. ---- */
.section {
  padding: var(--pad-section) var(--pad-x);
}
.section--bordered { border-bottom: 1px solid var(--rule); }
.section--plate {
  background: var(--plate);
  border-bottom: 1px solid var(--rule);
  padding: calc(var(--pad-section) - 20px) var(--pad-x);
}
.section--contact { padding: calc(var(--pad-section) + 20px) var(--pad-x) 40px; }

/* ---- Masthead. ---- */
.masthead { padding: var(--pad-hero) var(--pad-x) 0; }
.masthead__strip {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
  padding-bottom: 14px;
}
.masthead__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 40px;
  padding: calc(var(--gap) + 20px) 0 20px;
}
.masthead__col--right { text-align: right; }
.masthead__col--left { text-align: left; }
.masthead__col .kicker { margin-bottom: 12px; }
.editorial-name {
  font-family: var(--serif);
  font-size: 34px;
  font-style: italic;
  line-height: 1.1;
}
.masthead__crest { text-align: center; }

.masthead__wordmark { text-align: center; padding: 20px 0 40px; }
.masthead__wordmark h1 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(72px, 11vw, 180px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin: 0;
  text-wrap: balance;
  text-shadow: 0 0 22px rgba(232, 162, 59, 0.25);
}
.accent-dot { color: var(--accent); }

/* ---- Lede (3-column body). ---- */
.lede {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  font-family: var(--serif);
}
.lede__col .kicker { margin-bottom: 14px; }
.lede__p {
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}
.dropcap {
  font-size: 56px;
  float: left;
  line-height: 0.8;
  padding-right: 8px;
  padding-top: 6px;
  color: var(--accent);
}

/* ---- Inventory. ---- */
.chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 36px;
  font-family: var(--mono);
  font-size: 10px;
}
.chip {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 5px 12px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.chip:hover { color: var(--fg); border-color: var(--fg); }
.chip.is-active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.projects {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.projects[data-filter="tool"]       .project:not([data-kind="tool"]) { display: none; }
.projects[data-filter="library"]    .project:not([data-kind="library"]) { display: none; }
.projects[data-filter="field-note"] .project:not([data-kind="field-note"]) { display: none; }
.projects[data-filter="product"]    .project:not([data-kind="product"]) { display: none; }
.projects[data-filter="writing"]    .project:not([data-kind="writing"]) { display: none; }
.projects[data-filter="experiment"] .project:not([data-kind="experiment"]) { display: none; }
.projects[data-filter="archive"]    .project:not([data-kind="archive"]) { display: none; }

.project {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
  cursor: pointer;
  background: transparent;
  transition: background 200ms ease;
  min-height: 200px;
}
.project:hover { background: var(--plate); }
.project__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.status--active { color: var(--accent); }
.project__title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 48px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  color: var(--fg);
  transition: color 200ms ease;
}
.project:hover .project__title { color: var(--accent); }
.project__blurb {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  margin: 14px 0 0;
  text-wrap: pretty;
  max-height: 44px;
  overflow: hidden;
  transition: max-height 300ms ease, color 200ms;
}
.project:hover .project__blurb { max-height: 120px; }
.project__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
}

/* ---- Linkbacks + writing (two-up). ---- */
.two-up {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
}
.list { display: flex; flex-direction: column; }

.linkback {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  align-items: baseline;
}
.linkback--last { border-bottom: 1px solid var(--rule); }
.linkback:hover .linkback__name { color: var(--accent); }
.linkback__idx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
}
.linkback__name {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  display: block;
  transition: color 150ms ease;
}
.linkback__note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  display: block;
}
.linkback__url {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.writing-row {
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.writing-row--last { border-bottom: 1px solid var(--rule); }
.writing-row__title {
  font-family: var(--serif);
  font-size: 22px;
  text-wrap: balance;
}
.writing-row__meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ---- Uses grid. ---- */
.uses {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.uses__card {
  padding: 18px 16px;
  border: 1px solid var(--rule);
  background: var(--bg);
}
.uses__label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.uses__value {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  margin-top: 6px;
  text-wrap: balance;
}

/* ---- Contact / footer. ---- */
.email {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(44px, 6vw, 96px);
  letter-spacing: -0.03em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 4px solid var(--accent);
  margin-top: 18px;
}
.email:hover { color: var(--accent); }

.contact-row {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 36px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.15em;
  flex-wrap: wrap;
}
.contact-row a { text-decoration: none; color: inherit; }
.contact-row a:hover { color: var(--accent); }

.footer {
  margin-top: 80px;
  padding-top: 20px;
  border-top: 2px solid var(--fg);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- Command palette (native <dialog>). ---- */
.cmdk {
  width: min(640px, 92vw);
  margin: 12vh auto 0;
  padding: 0;
  background: #12100E;
  color: #EDE4D3;
  border: 1px solid rgba(232, 162, 59, 0.18);
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  overflow: hidden;
}
.cmdk::backdrop {
  background: rgba(10, 8, 6, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cmdk__form { display: flex; flex-direction: column; margin: 0; }
.cmdk__header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(232, 162, 59, 0.18);
  gap: 10px;
}
.cmdk__prompt { color: var(--accent); font-size: 12px; letter-spacing: 0.2em; }
.cmdk__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.cmdk__esc {
  font-size: 10px;
  opacity: 0.5;
  border: 1px solid rgba(232, 162, 59, 0.18);
  padding: 2px 6px;
  border-radius: 3px;
}
.cmdk__results { max-height: 48vh; overflow: auto; }
.cmdk__row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(232, 162, 59, 0.18);
  color: inherit;
  text-decoration: none;
  background: transparent;
  transition: background 120ms ease;
}
.cmdk__row:hover,
.cmdk__row.is-active { background: rgba(232, 162, 59, 0.08); }
.cmdk__row-kind {
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 10px;
  align-self: center;
}
.cmdk__row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmdk__row-label { font-weight: 600; }
.cmdk__row-sub {
  opacity: 0.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmdk__row-tag { opacity: 0.45; align-self: center; }
.cmdk__empty {
  padding: 22px;
  font-size: 12px;
  opacity: 0.5;
}
.cmdk__footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 10px;
  opacity: 0.5;
  letter-spacing: 0.1em;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .nav-compact__links { gap: 18px; }
}

@media (max-width: 900px) {
  :root {
    --pad-x: 24px;
    --pad-section: 56px;
    --pad-hero: 40px;
    --gap: 24px;
  }
  .nav-compact__links { display: none; }
  .masthead__grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 32px 0 16px;
  }
  .masthead__col--right,
  .masthead__col--left { text-align: center; }
  /* Crest renders first on mobile per handoff notes. */
  .masthead__crest { order: -1; }
  .editorial-name { font-size: 28px; }

  .lede { grid-template-columns: 1fr; gap: 32px; }
  .projects { grid-template-columns: 1fr; }
  .two-up { grid-template-columns: 1fr; gap: 48px; }
  .uses { grid-template-columns: repeat(2, 1fr); }

  .display { font-size: 48px; }

  .footer { flex-direction: column; align-items: flex-start; gap: 6px; }
  .contact-row { gap: 18px; }
}

@media (max-width: 560px) {
  :root { --pad-x: 18px; }
  .masthead__strip { font-size: 9px; letter-spacing: 0.18em; gap: 8px; flex-wrap: wrap; justify-content: center; }
  .masthead__strip span:nth-child(2) { display: none; }
  .uses { grid-template-columns: 1fr; }
  .project__title { font-size: 36px; }
  .chips { font-size: 9px; }
  .linkback { grid-template-columns: 24px 1fr; }
  .linkback__url { grid-column: 1 / -1; padding-top: 4px; }
}

/* ---- Reduced motion. ---- */
@media (prefers-reduced-motion: reduce) {
  .sw-flicker { animation: none; }
  .grain { display: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
