/* ============================================================
   yuccabuccA — Frutiger Aero design system
   Single shared stylesheet. Tokens first, components below.
   ============================================================ */

:root {
  /* --- palette: aqua sky --- */
  --sky-1:   #d8f1fb;   /* mist */
  --sky-2:   #b8e6f5;
  --sky-3:   #7dd3ec;
  --sky-4:   #43b7df;
  --sky-5:   #1d7fad;
  --ocean:   #0e3a5c;   /* deep water */

  /* --- palette: ink (text) --- */
  --ink:     #06283d;
  --ink-2:   #1a3a55;
  --ink-3:   #4a6075;

  /* --- palette: nature accents --- */
  --mint:    #c7f3d4;
  --leaf:    #5fc973;
  --leaf-2:  #2f8a47;
  --sun:     #ffd66b;
  --coral:   #ff8a6b;

  /* --- palette: surfaces --- */
  --cream:   #fafdff;
  --paper:   #ffffff;

  /* --- glass --- */
  --glass-bg:       rgba(255, 255, 255, 0.55);
  --glass-bg-soft:  rgba(255, 255, 255, 0.38);
  --glass-border:   rgba(255, 255, 255, 0.75);
  --glass-shadow:   0 8px 32px rgba(14, 58, 92, 0.18);
  --glass-inset:    inset 0 1px 0 rgba(255, 255, 255, 0.95),
                    inset 0 -1px 0 rgba(14, 58, 92, 0.08);

  /* --- radii --- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 9999px;

  /* --- spacing scale (1.5x) --- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2.25rem;
  --s-7: 3.5rem;
  --s-8: 5rem;

  /* --- type --- */
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui,
               "Helvetica Neue", Arial, sans-serif;
  --measure: 70ch;
  --container: 72rem;

  /* --- motion --- */
  --t-fast: 120ms;
  --t-med:  220ms;
  --ease:   cubic-bezier(0.2, 0.8, 0.2, 1);

  /* --- shadows --- */
  --sh-1: 0 1px 2px rgba(14, 58, 92, 0.08),
          0 4px 12px rgba(14, 58, 92, 0.10);
  --sh-2: 0 2px 6px rgba(14, 58, 92, 0.10),
          0 12px 32px rgba(14, 58, 92, 0.18);
}

/* ============================================================
   Reset / base
   ============================================================ */

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

html {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--sky-1);
  background-image:
    /* soft sun bloom */
    radial-gradient(ellipse 60% 40% at 75% 8%,
      rgba(255, 245, 200, 0.55) 0%, rgba(255, 245, 200, 0) 60%),
    /* low bokeh orbs */
    radial-gradient(circle 18rem at 12% 88%,
      rgba(127, 220, 125, 0.28) 0%, rgba(127, 220, 125, 0) 70%),
    radial-gradient(circle 22rem at 88% 70%,
      rgba(125, 211, 236, 0.45) 0%, rgba(125, 211, 236, 0) 70%),
    radial-gradient(circle 14rem at 30% 30%,
      rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 70%),
    /* sky gradient base */
    linear-gradient(180deg,
      var(--sky-1) 0%, var(--sky-2) 35%,
      var(--sky-3) 70%, var(--sky-4) 100%);
  background-attachment: fixed;
  background-size: cover;
}

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

a { color: var(--sky-5); text-decoration: underline; text-underline-offset: 0.18em; }
a:hover { color: var(--ocean); }

:focus-visible {
  outline: 3px solid var(--sky-5);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection { background: var(--sky-3); color: var(--ocean); }

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--s-4);
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.85rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 1.6vw, 1.3rem); }
h5 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }

p { margin: 0 0 var(--s-4); max-width: var(--measure); }
small, .meta { font-size: 0.875rem; color: var(--ink-3); }

.tagline { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-2); }
.subtitle { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--ink-2); margin-top: -0.5rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sky-5);
  font-weight: 700;
  margin-bottom: var(--s-2);
}

/* ============================================================
   Layout primitives
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--ocean);
  color: var(--paper);
  padding: var(--s-2) var(--s-4);
  text-decoration: none;
  border-radius: 0 0 var(--r-md) 0;
  z-index: 1000;
}
.skip-link:focus { top: 0; }

/* ============================================================
   Glass panel
   ============================================================ */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  padding: var(--s-5);
}

.glass--soft {
  background: var(--glass-bg-soft);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.glass--tight { padding: var(--s-3) var(--s-4); }
.glass--loose { padding: var(--s-6); }

@supports not (backdrop-filter: blur(1px)) {
  .glass { background: rgba(255, 255, 255, 0.85); }
}

/* ============================================================
   Gel buttons (Aero-style)
   ============================================================ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid rgba(14, 58, 92, 0.4);
  border-radius: var(--r-pill);
  cursor: pointer;
  user-select: none;
  background-image:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.65) 0%,
      rgba(255, 255, 255, 0.10) 48%,
      rgba(255, 255, 255, 0.00) 50%,
      rgba(0, 0, 0, 0.06)        100%),
    linear-gradient(to bottom, var(--sky-3), var(--sky-5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(14, 58, 92, 0.30),
    0 1px 2px rgba(14, 58, 92, 0.20),
    0 6px 18px rgba(29, 127, 173, 0.35);
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-med) var(--ease),
    filter var(--t-fast) var(--ease);
}

.button:hover {
  filter: brightness(1.06) saturate(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(14, 58, 92, 0.30),
    0 2px 4px rgba(14, 58, 92, 0.22),
    0 10px 24px rgba(29, 127, 173, 0.45);
}

.button:active {
  transform: translateY(1px);
  background-image:
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.10) 0%,
      rgba(0, 0, 0, 0.00) 50%,
      rgba(255, 255, 255, 0.10) 100%),
    linear-gradient(to bottom, var(--sky-5), var(--sky-3));
  box-shadow:
    inset 0 2px 4px rgba(14, 58, 92, 0.30),
    0 1px 2px rgba(14, 58, 92, 0.15);
}

.button:disabled,
.button[aria-disabled="true"] {
  filter: grayscale(0.6);
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* button variants */

.button--leaf {
  border-color: rgba(47, 138, 71, 0.5);
  background-image:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.65) 0%,
      rgba(255, 255, 255, 0.10) 48%,
      rgba(255, 255, 255, 0.00) 50%,
      rgba(0, 0, 0, 0.06)        100%),
    linear-gradient(to bottom, var(--leaf), var(--leaf-2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(31, 80, 41, 0.30),
    0 1px 2px rgba(31, 80, 41, 0.20),
    0 6px 18px rgba(95, 201, 115, 0.35);
}

.button--ghost {
  color: var(--ocean);
  border-color: rgba(14, 58, 92, 0.25);
  background-image:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.55) 50%,
      rgba(255, 255, 255, 0.40) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(14, 58, 92, 0.10),
    0 1px 2px rgba(14, 58, 92, 0.10);
}

.button--lg { padding: 0.95rem 1.8rem; font-size: 1.05rem; }
.button--sm { padding: 0.45rem 1rem; font-size: 0.85rem; }

/* ============================================================
   Card (project tile)
   ============================================================ */

.card {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1), var(--glass-inset);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2), var(--glass-inset);
}

.card__media {
  margin: 0;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--sky-2), var(--sky-4));
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.card__body {
  padding: var(--s-4) var(--s-5) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  flex: 1;
}

.card__title { margin: 0; font-size: 1.2rem; }
.card__desc  { margin: 0; color: var(--ink-2); }
.card__meta  { margin: 0; font-size: 0.825rem; color: var(--ink-3); }
.card__actions {
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: var(--s-2);
}

/* card media variants */

/* logo treatment — for transparent-bg logos that should sit centered, not cropped */
.card__media--logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.55), transparent 70%),
    linear-gradient(135deg, var(--sky-2), var(--sky-4));
}
.card__media--logo img {
  width: auto;
  height: auto;
  max-width: 75%;
  max-height: 80%;
  object-fit: contain;
}

/* CSS-only gradient placeholders (used until real screenshots land) */
.card__media--leaf {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.45), transparent 60%),
    linear-gradient(135deg, var(--mint), var(--leaf) 60%, var(--leaf-2));
}
.card__media--sunset {
  background:
    radial-gradient(ellipse at 70% 20%, rgba(255,255,255,0.5), transparent 60%),
    linear-gradient(135deg, var(--sun), var(--coral) 70%, var(--sky-5));
}
.card__media--meadow {
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255,255,255,0.55), transparent 65%),
    linear-gradient(135deg, var(--sky-3) 0%, var(--leaf) 60%, var(--sun) 100%);
}

/* Two-image hover swap — first image is the resting state, second
   crossfades in on hover or focus-within (keyboard-friendly). */
.card__media--swap {
  position: relative;
}
.card__media--swap .card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 500ms var(--ease);
}
.card__media--swap .card__img--alt {
  opacity: 0;
}
.card:hover .card__media--swap .card__img--alt,
.card:focus-within .card__media--swap .card__img--alt {
  opacity: 1;
}

/* grid */
.project-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

/* ============================================================
   Swatches (style guide only)
   ============================================================ */

.swatches {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.swatch {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid rgba(14, 58, 92, 0.12);
  background: var(--paper);
  box-shadow: var(--sh-1);
}
.swatch__chip {
  height: 5rem;
  border-bottom: 1px solid rgba(14, 58, 92, 0.08);
}
.swatch__label {
  display: block;
  padding: var(--s-2) var(--s-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--ink-2);
}

/* ============================================================
   Utility
   ============================================================ */

.row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.row--lg { gap: var(--s-5); }

.note {
  font-size: 0.875rem;
  color: var(--ink-3);
  border-left: 3px solid var(--sky-4);
  padding: var(--s-2) var(--s-4);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

hr.rule {
  border: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent, rgba(14, 58, 92, 0.25), transparent);
  margin: var(--s-7) 0;
}

/* ============================================================
   Site header — sticky glass nav bar
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 20px rgba(14, 58, 92, 0.08);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: rgba(255, 255, 255, 0.92); }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-3);
  flex-wrap: wrap;
}

.site-logo {
  display: inline-flex;
  align-items: center;
}
.site-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
}

.site-nav a {
  display: inline-block;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  text-decoration: none;
  color: var(--ocean);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--sky-5);
}

@media (max-width: 36rem) {
  .site-nav a { padding: var(--s-2) var(--s-3); font-size: 0.85rem; }
  .site-logo img { height: 30px; }
}

/* ============================================================
   Featured-article media (hero image with caption)
   ============================================================ */

.featured-media {
  margin: 0 0 var(--s-4);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-1);
  background: rgba(255, 255, 255, 0.4);
}

.featured-media img {
  width: 100%;
  height: auto;
  display: block;
}

.featured-media figcaption {
  font-size: 0.875rem;
  color: var(--ink-2);
  padding: var(--s-3) var(--s-4);
  background: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(14, 58, 92, 0.06);
}

/* Two-image hover swap for the featured slot. Layout is anchored by
   the main image; the alt is absolutely positioned over it so that
   figcaption flows naturally below both. */
.featured-media--swap .featured-media__images {
  position: relative;
  overflow: hidden;
}
.featured-media--swap .featured-img--main {
  display: block;
  width: 100%;
  height: auto;
}
.featured-media--swap .featured-img--alt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.featured-media--swap:hover .featured-img--alt,
.featured-media--swap:focus-within .featured-img--alt {
  opacity: 1;
}

/* placeholder for the featured slot until a real Orca screenshot lands */
.featured-media--placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    /* sun glint */
    radial-gradient(ellipse 50% 30% at 50% 0%,
      rgba(255, 245, 200, 0.55) 0%, transparent 65%),
    /* light caustic shimmer */
    radial-gradient(circle 14rem at 20% 35%,
      rgba(255, 255, 255, 0.25) 0%, transparent 70%),
    radial-gradient(circle 10rem at 80% 55%,
      rgba(255, 255, 255, 0.22) 0%, transparent 70%),
    /* deep ocean column */
    linear-gradient(180deg,
      var(--sky-3) 0%,
      var(--sky-5) 45%,
      var(--ocean) 100%);
}

.featured-media--placeholder figcaption {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ============================================================
   Embedded media (Spotify, SoundCloud iframes)
   ============================================================ */

.embed-frame {
  width: 100%;
  border: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--sh-1);
}

/* ============================================================
   Track list (music section)
   ============================================================ */

.track-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s-4);
}

.track-list h4 {
  margin: 0 0 var(--s-3);
}

/* ============================================================
   Site footer
   ============================================================ */

.site-footer {
  margin-top: var(--s-8);
  padding-block: var(--s-6);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  text-align: center;
  color: var(--ink-2);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-footer { background: rgba(255, 255, 255, 0.85); }
}

.site-footer__nav ul {
  list-style: none;
  margin: 0 0 var(--s-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-4);
}

.site-footer__nav a {
  color: var(--ocean);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 0.18em;
}

.site-footer__nav a:hover {
  text-decoration: underline;
  color: var(--sky-5);
}

.donate {
  max-width: var(--measure);
  margin-inline: auto;
  font-size: 0.95rem;
  color: var(--ink-2);
}

.site-footer__small {
  margin: var(--s-3) 0 0;
  color: var(--ink-3);
  max-width: none;
}

/* ============================================================
   Octopus skin — WebGL chromatophore canvas, fixed behind content
   The canvas is created and managed by octopus-skin.js. It paints
   semi-transparent pigment cells over the body's CSS sky gradient.
   Falls back to a no-op (canvas removed) under reduced-motion or
   missing WebGL — body bg alone still renders correctly.
   ============================================================ */

.octopus-skin {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  /* small fade-in so first paint isn't a hard pop */
  opacity: 0;
  animation: octopus-skin-fade-in 1.2s var(--ease) forwards;
}

@keyframes octopus-skin-fade-in {
  to { opacity: 1; }
}

/* Ensure content sits above the chromatophore canvas */
main,
.site-footer { position: relative; z-index: 1; }
/* .site-header already has z-index: 100 — sticky header sits above everything. */

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
