/* dolma33 · one page site
   Palette and type from the visual identity study:
   cream and cosmos ink carry the text, magenta is the only bright accent. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */

@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/unbounded-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/unbounded-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-400italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/inter-500.woff2') format('woff2');
}

/* ---------- Design tokens ---------- */

:root {
  /* Full palette from the visual identity study.
     Rule: cream and ink carry the text, magenta is the only bright
     accent on the page, the other colors live inside the images. */
  --cream: #F2E9CE;    /* neutral: the paper */
  --ink: #0C0A18;      /* neutral: cosmos ink */
  --magenta: #FF2E8B;  /* signature pop */
  --acid: #93E22B;     /* signature pop */
  --cyan: #33D6D6;     /* signature pop */
  --violet: #8B5CF6;   /* support accent */
  --gold: #FFC83D;     /* support accent */
  --coral: #FF6A45;    /* support accent */

  /* The one accent actually used on the page */
  --accent: var(--magenta);

  --pad: clamp(22px, 4.6vw, 56px);
  --pad-bottom: 24px; /* fixed: the footer keeps the same distance from the bottom at every viewport size */
  --plate-size: clamp(64px, 7.5vw, 96px);
  --plate-gap: clamp(9px, 1.4vw, 14px);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

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

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--ink);
  color: var(--cream);
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Cover and veil ---------- */

.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(6, 4, 14, .58) 0%, rgba(6, 4, 14, .29) 28%, rgba(6, 4, 14, 0) 52%),
    linear-gradient(to top, rgba(6, 4, 14, .58) 0%, rgba(6, 4, 14, .26) 24%, rgba(6, 4, 14, 0) 46%);
}

/* ---------- Star halos ----------
   Faint glows that main.js pins on the stars painted in the artwork,
   each pulsing at its own pace */

.stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 252, 230, .75) 0%,
    rgba(255, 252, 230, .22) 35%,
    rgba(255, 252, 230, 0) 70%);
  opacity: 0;
  animation: star-twinkle 6s ease-in-out infinite;
}

@keyframes star-twinkle {
  0%, 100% { opacity: 0; transform: scale(.8); }
  50%      { opacity: 1; transform: scale(1); }
}

/* ---------- Layer grid ----------
   Two layouts, switched by data-plates on <body>:
   "vertical"   plates column on the right edge, full height
   "horizontal" plates row centered in the middle of the page */

.layer {
  position: absolute;
  inset: 0;
  padding: var(--pad) var(--pad) var(--pad-bottom);
  display: grid;
  gap: clamp(16px, 3vw, 24px);
}

body[data-plates="vertical"] .layer {
  grid-template:
    "head  plates" auto
    "links plates" 1fr
    "foot  foot"   auto
    / 1fr auto;
}

body[data-plates="horizontal"] .layer {
  grid-template:
    "head  head"   auto
    "links plates" 1fr
    "foot  foot"   auto
    / auto 1fr;
}

.masthead { grid-area: head; }
.elsewhere { grid-area: links; align-self: center; }
.plates { grid-area: plates; min-height: 0; }
.colophon { grid-area: foot; }

/* ---------- Masthead ---------- */

.masthead h1 {
  margin: 0;
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 7vw, 60px);
  line-height: .9;
  letter-spacing: -.03em;
  text-transform: lowercase;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .55);
}

.masthead .rule {
  height: 1px;
  width: clamp(74px, 16vw, 124px);
  background: rgba(242, 233, 206, .5);
  margin: clamp(12px, 2vw, 16px) 0 clamp(9px, 1.6vw, 12px);
}

.masthead .tagline {
  margin: 0;
  font-size: clamp(10px, 1.6vw, 12px);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(242, 233, 206, .92);
  animation: tagline-glow 7s ease-in-out infinite alternate;
}

/* The tagline does not move: it glows, slowly */

@keyframes tagline-glow {
  from { text-shadow: 0 0 0 rgba(242, 233, 206, 0); }
  to   { text-shadow: 0 0 14px rgba(242, 233, 206, .55); }
}

/* ---------- Elsewhere (objkt and socials) ---------- */

.elsewhere {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 22px);
  justify-self: start;
}

.elsewhere .primary {
  display: inline-flex;
  align-items: baseline;
  gap: clamp(10px, 2vw, 14px);
  width: fit-content;
  text-decoration: none;
}

.elsewhere .primary-name {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 500;
  color: var(--cream);
  letter-spacing: -.01em;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}

.elsewhere .kicker {
  font-size: clamp(8px, 1.6vw, 10px);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .65);
  transition: transform .22s ease;
}

.elsewhere .primary:hover .kicker {
  transform: translate(3px, -2px);
}

.elsewhere .socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(9px, 1.6vw, 12px);
  width: fit-content;
}

.elsewhere .socials a {
  display: inline-block;
  font-size: clamp(15px, 2.4vw, 18px);
  color: rgba(242, 233, 206, .82);
  text-decoration: none;
  letter-spacing: .01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  transition: color .18s ease, transform .22s ease;
}

.elsewhere .primary:hover .primary-name { color: #fff; }

.elsewhere .socials a:hover {
  color: var(--cream);
  transform: translateX(5px);
}

/* ---------- Colophon ---------- */

.colophon {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(242, 233, 206, .16);
  padding-top: clamp(12px, 2vw, 16px);
}

/* Every few seconds a faint spark travels along the footer rule,
   echoing the glimmer of the artworks */

.colophon::after {
  content: '';
  position: absolute;
  top: -1px;
  left: -140px;
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 233, 206, .38), transparent);
  opacity: 0;
  pointer-events: none;
  animation: colophon-spark 9s ease-in-out infinite;
}

@keyframes colophon-spark {
  0%   { left: -140px; opacity: 0; }
  4%   { opacity: 1; }
  26%  { opacity: 1; }
  30%  { left: 100%;  opacity: 0; }
  100% { left: 100%;  opacity: 0; }
}

.colophon .contact {
  font-size: clamp(11px, 1.8vw, 12px);
  color: rgba(242, 233, 206, .82);
  text-decoration: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  line-height: 1;
  transition: color .18s ease;
}

.colophon .contact:hover { color: var(--cream); }

.colophon .mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.colophon .year {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(242, 233, 206, .7);
  line-height: 1;
}

.colophon .mark img {
  width: clamp(38px, 5.6vw, 52px);
  height: auto;
  display: block;
  animation: logo-breathe 5.5s ease-in-out infinite alternate;
}

/* The d33 mark breathes: a slow, faint swell and release */

@keyframes logo-breathe {
  from { transform: scale(1); }
  to   { transform: scale(1.07); }
}

/* ---------- Plates ---------- */

.plates-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--plate-gap);
  min-height: 0;
}

.plate {
  position: relative;
  width: var(--plate-size);
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid rgba(242, 233, 206, .55);
  background:
    repeating-linear-gradient(135deg, rgba(242, 233, 206, .09) 0 7px, rgba(242, 233, 206, .02) 7px 14px),
    rgba(6, 4, 14, .5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
  transition: transform .18s ease, filter .18s ease, border-color .18s ease;
}

.plate:hover {
  transform: scale(1.04);
  border-color: var(--accent);
  filter: brightness(1.2);
}

.plate-label {
  position: absolute;
  left: 7px;
  bottom: 5px;
  font: 8px var(--mono);
  color: rgba(242, 233, 206, .92);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .8);
  z-index: 1;
  pointer-events: none;
  max-width: calc(100% - 14px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Filled plates show the token title on a faint dark pill so it stays
   readable on light artworks */

.plate.is-filled .plate-label {
  left: 5px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(6, 4, 14, .55);
}

/* A plate that received a real mint from objkt (filled in by main.js) */

.plate-link {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 9px;
  overflow: hidden;
}

.plate-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.plates-caption {
  font: 9px var(--mono);
  letter-spacing: .06em;
  color: rgba(242, 233, 206, .65);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .85);
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}

.plates-caption:hover { color: var(--accent); }

/* Vertical: caption reads bottom to top beside a column of tiles */

body[data-plates="vertical"] .plates {
  display: flex;
  flex-direction: row;
  gap: 11px;
  justify-self: end;
}

body[data-plates="vertical"] .plates-caption {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  align-self: center;
}

body[data-plates="vertical"] .plates-row {
  flex-direction: column;
  justify-content: center;
}

/* Horizontal: row of tiles sitting just above the footer rule,
   caption tucked under the first tile */

body[data-plates="horizontal"] .plates {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  justify-self: end;
  align-self: end;
}

body[data-plates="horizontal"] .plates-caption { order: 2; }
body[data-plates="horizontal"] .plates-row { order: 1; }

/* ---------- Narrow screens ---------- */

@media (max-width: 680px) {
  body[data-plates] .layer {
    grid-template:
      "head"   auto
      "links"  1fr
      "plates" auto
      "foot"   auto
      / 1fr;
  }

  body[data-plates] .plates {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    justify-self: stretch;
    align-self: end;
  }

  body[data-plates] .plates-caption {
    writing-mode: horizontal-tb;
    transform: none;
    order: 2;
  }

  body[data-plates] .plates-row {
    flex-direction: row;
    order: 1;
    width: 100%;
  }

  body[data-plates] .plate {
    flex: 1 1 0;
    width: auto;
    max-width: var(--plate-size);
    min-width: 0;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .plate,
  .elsewhere .socials a,
  .elsewhere .kicker,
  .colophon .contact,
  .plates-caption {
    transition: none;
  }

  .colophon::after {
    animation: none;
    opacity: 0;
  }

  .colophon .mark img,
  .masthead .tagline {
    animation: none;
  }

  .star {
    animation: none;
    opacity: 0;
  }
}
