@import url("variables.css");

/* ==========================================================================
   style.css
   --------------------------------------------------------------------------
   1.  Reset & base
   2.  Type
   3.  Layout & rules
   4.  Nav
   5.  Hero
   6.  Section headers
   7.  Blocks & grids
   8.  Lists
   9.  Buttons & links
   10. Media (audio embed)
   11. Footer
   12. Mobile
   13. Print
   ========================================================================== */

/* ==========================================================================
   1. Reset & base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  text-align: left;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

ul,
ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: var(--rule) solid var(--blue);
  outline-offset: 2px;
}

/* ==========================================================================
   2. Type
   ========================================================================== */

h1,
h2,
h3 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* Lowercase styling for titles and buttons */
h1,
h2,
h3,
.page-title,
.hero-name,
.block-title,
.btn,
.wordmark {
  text-transform: lowercase;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.2;
}

p {
  max-width: 68ch;
}

strong {
  font-weight: 700;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper-2);
  padding: 0.1em 0.3em;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.45;
}

.small {
  font-size: var(--fs-sm);
}

.mono {
  font-family: var(--mono);
}

.grey {
  color: var(--grey);
}

/* Uppercase monospace label */
.label {
  display: block;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

/* ==========================================================================
   3. Layout & rules
   ========================================================================== */

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Sections are separated by a hard rule */
.section {
  padding: var(--s5) 0;
  border-top: var(--rule) solid var(--ink);
}

.section:first-of-type {
  border-top: none;
}

.stack > * + * {
  margin-top: var(--s2);
}

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

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s1) var(--s2);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  text-decoration: none;
  transform: translateY(-100%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   4. Nav
   ========================================================================== */

.masthead {
  border-bottom: none;
  position: relative;
  z-index: 1;
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  padding: var(--s2) var(--gutter);
  max-width: var(--page-max);
  margin: 0 auto;
}

.wordmark {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

/* Flatten the colored spans — just plain text now */
.wordmark-ink,
.wordmark-red {
  background: none;
  color: inherit;
  padding: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

.nav a {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}

.nav a:hover {
  text-decoration: underline;
}

.nav a[aria-current="page"] {
  text-decoration: underline;
}

/* Theme toggle */
.theme-toggle {
  font-size: var(--fs-sm);
  padding: 0.25em 0.4em;
  border: var(--rule) solid var(--ink);
  color: var(--ink);
  line-height: 1;
  cursor: pointer;
}

.theme-toggle:hover {
  text-decoration: underline;
}

/* ==========================================================================
   5. Hero
   ========================================================================== */

/* Bulb image — centered above everything, hidden in dark mode */
.hero-bulb {
  display: flex;
  justify-content: center;
  margin-top: -4rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
  position: relative;
  z-index: 0;
}

.hero-bulb img {
  width: 140px;
  height: auto;
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .hero-bulb {
  opacity: 0;
  transform: translateY(-3rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-bulb {
    opacity: 0;
    transform: translateY(-3rem);
  }
}

.hero {
  padding: var(--s5) 0 var(--s6);
}

/* Landing page hero — no borders around it */
.hero.hero-landing {
  padding: var(--s5) var(--gutter);
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1917 url("../back/back.JPG") center / cover no-repeat;
  color: #ffffff;
  border: none;
}

/* Dark overlay for text contrast safety */
.hero.hero-landing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.hero.hero-landing > * {
  position: relative;
  z-index: 1;
}

/* Remove section border that follows the hero */
.hero.hero-landing + .section {
  border-top: none;
}

.hero-name {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.hero-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

/* Cubist offset */
.hero-name > span + span {
  margin-left: var(--s2);
}

.hero-name .plane-red,
.hero-name .plane-blue,
.hero-name .plane-ink {
  padding: 0 var(--s1);
  color: inherit;
  background: none;
}

.hero-landing .lead {
  color: #ffffff;
}

.hero-roles {
  margin-top: var(--s3);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

.hero-landing .hero-roles {
  color: #ffffff;
}

.hero-roles li {
  border-top: var(--rule) solid var(--ink);
  padding: var(--s1) 0;
  max-width: 24rem;
}

.hero-landing .hero-roles li {
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-roles li:last-child {
  border-bottom: var(--rule) solid var(--ink);
}

.hero-landing .hero-roles li:last-child {
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-landing .btn-row .btn {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper);
}

.hero-landing .btn-row .btn-solid {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ==========================================================================
   6. Section headers
   ========================================================================== */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2);
  margin-bottom: var(--s4);
}

/* Solid numbered square */
.section-num {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--fs-sm);
}

.section-num-red {
  background: var(--ink);
}

.section-num-blue {
  background: var(--ink);
}

.page-title {
  font-size: var(--fs-h1);
  text-transform: lowercase;
  margin-bottom: 0;
}

/* ==========================================================================
   7. Blocks & grids
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--s2);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.block {
  background: var(--paper);
  border: var(--rule) solid var(--ink);
  padding: var(--s2);
}

.block-title {
  font-size: var(--fs-h3);
  margin-bottom: var(--s1);
}

.block-title a {
  color: var(--ink);
  text-decoration: none;
}

.block-title a:hover {
  text-decoration: underline;
}

.block-meta {
  font-family: var(--mono);
  font-size: var(--fs-label);
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--grey);
  margin-bottom: var(--s1);
}

.block p {
  font-size: var(--fs-sm);
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: var(--s2);
}

.tag {
  font-family: var(--mono);
  font-size: var(--fs-label);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  border: var(--rule) solid var(--ink);
  padding: 0.1em 0.4em;
}

/* Two-column split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  align-items: start;
}

.split > .ruled {
  border-top: none;
}

.panel {
  border: var(--rule) solid var(--ink);
  padding: var(--s2);
}

.todo {
  border: var(--rule) dashed var(--ink);
  padding: var(--s2);
  font-family: var(--mono);
  font-size: var(--fs-sm);
}

.todo strong {
  display: block;
  margin-bottom: var(--s1);
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   8. Lists
   ========================================================================== */

.ruled {
  border-top: var(--rule) solid var(--ink);
}

.ruled li {
  border-bottom: var(--rule) solid var(--ink);
  padding: var(--s2) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}

.ruled .mono {
  font-size: var(--fs-sm);
}

.bullets li {
  position: relative;
  padding-left: var(--s2);
  margin-top: var(--s1);
  font-size: var(--fs-sm);
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--ink);
}

/* ==========================================================================
   9. Buttons & links
   ========================================================================== */

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  text-transform: lowercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  padding: 0.75rem var(--s2);
  min-height: 44px;
  border: var(--rule) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.btn:hover {
  text-decoration: underline;
}

.btn-solid {
  background: var(--ink);
  color: var(--paper);
}

.btn-solid:hover {
  text-decoration: underline;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: var(--s3);
}

a.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a.link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   10. Media
   ========================================================================== */

/* Wavesurfer track player */
.track-list {
  display: grid;
  gap: var(--s3);
}

.track {
  border: var(--rule) solid var(--ink);
  padding: var(--s2);
}

.track-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s2);
}

.track-play {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
}

.track-title {
  font-weight: 700;
  font-size: var(--fs-body);
}

.track-time {
  margin-left: auto;
}

.track-waveform {
  margin-bottom: var(--s1);
  min-height: 64px;
  background: repeating-linear-gradient(
    90deg,
    var(--paper-3) 0px,
    var(--paper-3) 2px,
    transparent 2px,
    transparent 4px
  );
}

.track-waveform canvas,
.track-waveform wave {
  position: relative;
  z-index: 1;
}

.track-spectrogram {
  opacity: 0.85;
  min-height: 0;
}

.track.is-playing {
  border-color: var(--red);
}

.embed {
  border: var(--rule) solid var(--ink);
}

.embed iframe {
  width: 100%;
  border: 0;
}

/* ==========================================================================
   11. Footer
   ========================================================================== */

.footer {
  border-top: var(--rule-thick) solid var(--ink);
  margin-top: var(--s5);
  padding: var(--s3) 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: var(--fs-label);
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

.footer a {
  color: var(--ink);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* ==========================================================================
   12. Mobile
   ========================================================================== */

@media (max-width: 700px) {
  .split {
    grid-template-columns: 1fr;
    gap: var(--s3);
  }

  .hero-name > span + span {
    margin-left: 0;
  }

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

/* ==========================================================================
   13. Print
   ========================================================================== */

@media print {
  .masthead,
  .footer,
  .skip-link,
  .embed {
    display: none;
  }

  a {
    text-decoration: underline;
  }
}
