/* Luci Eveningstar — page styles. Tokens and components come from
   nocturne.css (the Nocturne design system); nothing here hard-codes a
   colour. The page's Content-Security-Policy forbids inline styles, so
   every rule from the design lives in this file. */

html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
a { color: var(--color-accent-300); }
a:hover { color: var(--color-accent-100); }

@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }
@keyframes shoot {
  0% { opacity: 0; transform: rotate(-18deg) translateX(0); }
  1.5% { opacity: .9; }
  6% { opacity: 0; transform: rotate(-18deg) translateX(-520px); }
  100% { opacity: 0; transform: rotate(-18deg) translateX(-520px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.kicker {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--color-accent-300);
}
.hatch {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: repeating-linear-gradient(135deg, var(--color-neutral-900) 0 10px, transparent 10px 20px);
  font: 12px ui-monospace, Menlo, monospace; color: var(--color-neutral-400);
}
.noscript { position: relative; z-index: 1; padding: 48px; }

/* — sky — */
.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(90% 70% at 78% 8%, var(--color-neutral-800), transparent 70%),
    linear-gradient(180deg, var(--color-neutral-900), var(--color-bg) 60%);
}
.star {
  position: absolute; border-radius: 50%; background: var(--color-neutral-100);
  opacity: .15; animation: twinkle var(--twinkle, 5s) ease-in-out var(--offset, 0s) infinite;
}
.shooting-star {
  position: absolute; top: 16%; right: 8%; width: 140px; height: 1px;
  background: linear-gradient(to left, transparent, var(--color-neutral-100));
  opacity: 0; animation: shoot 16s linear 3s infinite;
}

/* — gate — */
.gate {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-wrap: wrap; align-items: center; gap: 48px;
  padding: clamp(28px, 7vw, 96px);
  transition: opacity 1s ease, transform 1.2s ease;
}
.gate.is-opening { opacity: 0; transform: translateY(-16px) scale(1.02); }
.gate-copy {
  flex: 1 1 320px; max-width: 520px;
  display: flex; flex-direction: column; gap: var(--space-6);
}
.gate-title { font-size: clamp(40px, 6.2vw, 76px); margin: 0; letter-spacing: -.025em; line-height: 1.02; }
.gate-lede { margin: 0; font-size: 17px; color: var(--color-neutral-300); max-width: 38ch; text-wrap: pretty; }
.gate-dots { display: flex; flex-wrap: wrap; gap: 10px; min-height: 14px; margin-top: var(--space-4); }
.gate-dots.is-shaking { animation: shake .45s ease; }
.gate-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--color-neutral-500); background: var(--color-neutral-100);
  box-shadow: 0 0 10px var(--color-accent-400);
}
/* Waiting on the API: the dots ripple in turn and the moon breathes. */
.gate.is-busy .gate-dot { animation: pulse 1.2s ease-in-out infinite; }
.gate.is-busy .gate-dot:nth-child(4n+2) { animation-delay: .15s; }
.gate.is-busy .gate-dot:nth-child(4n+3) { animation-delay: .3s; }
.gate.is-busy .gate-dot:nth-child(4n+4) { animation-delay: .45s; }
.gate.is-busy .moon { animation: breathe 2.4s ease-in-out infinite; }
.gate.is-busy .gate-msg { color: var(--color-neutral-200); }
.gate-msg { font-size: 13px; min-height: 20px; color: var(--color-neutral-400); transition: color .3s; }
.gate-msg.is-error { color: var(--color-accent-300); }
.gate-msg.is-success { color: var(--color-accent-200); }
.gate-moon-wrap { flex: 1 1 300px; display: flex; justify-content: center; align-items: center; min-height: 280px; }
.moon {
  position: relative; width: min(240px, 60vw); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 38% 34%, var(--color-neutral-100), var(--color-neutral-300) 70%);
  transition: box-shadow 1s ease;
}
.moon-shade {
  position: absolute; inset: -2px; border-radius: 50%; background: var(--color-bg);
  transform: translateX(16%); transition: transform .9s cubic-bezier(.4, 0, .2, 1);
}
/* The real input covers the gate invisibly, so a tap anywhere focuses it. */
.gate-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; cursor: default;
}

/* — portfolio — */
.portfolio { position: relative; z-index: 1; animation: fadeUp 1.2s ease both; }
.site-nav, .section, .site-footer { max-width: 1180px; margin: 0 auto; }
.site-nav { padding: 22px clamp(20px, 5vw, 56px); flex-wrap: wrap; }
.site-brand { display: flex; align-items: center; gap: 10px; }
.brand-moon {
  width: 16px; height: 16px; border-radius: 50%;
  box-shadow: inset 5px -2px 0 0 var(--color-neutral-200);
}
.section { padding: 0 clamp(20px, 5vw, 56px) 96px; }
.hero { padding-top: clamp(48px, 9vw, 120px); padding-bottom: 56px; }
.hero-kicker { margin-bottom: var(--space-6); }
.hero-title {
  font-size: clamp(34px, 5.2vw, 64px); letter-spacing: -.025em; line-height: 1.05;
  max-width: 16ch; margin: 0; text-wrap: balance;
}
.section-label { color: var(--color-accent-300); margin-bottom: var(--space-6); }
.section-title { margin-bottom: var(--space-8); text-wrap: balance; }

.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: 32px; }
.filter { font-size: 13px; color: var(--color-neutral-300); }
.filter.is-active { border-color: var(--color-accent); color: var(--color-accent-300); }

.works { columns: 3 260px; column-gap: 24px; }
.works-empty { font-size: 15px; color: var(--color-neutral-400); }
.work-card {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: left;
  break-inside: avoid; margin-bottom: 32px; cursor: pointer; border-radius: var(--radius-md);
  transition: transform .4s ease;
}
.work-card:hover { transform: translateY(-4px); }
.work-frame {
  display: block; aspect-ratio: 4 / 5; border-radius: var(--radius-md);
  overflow: hidden; background: var(--color-surface);
}
.work-frame img, .about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.work-frame .hatch, .about-portrait .hatch { width: 100%; height: 100%; }
.work-caption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-top: var(--space-3);
}
.work-title { font-size: 15px; font-weight: 500; }
.work-meta { font-size: 12px; color: var(--color-neutral-400); white-space: nowrap; }

.about { display: flex; flex-wrap: wrap; gap: clamp(28px, 5vw, 64px); align-items: flex-start; }
.about-portrait {
  flex: 0 1 300px; min-width: 220px; aspect-ratio: 4 / 5;
  border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface);
}
.about-copy { flex: 1 1 340px; max-width: 560px; }
.about-copy p { font-size: 16px; color: var(--color-neutral-300); text-wrap: pretty; }

.inquire-inner { max-width: 520px; }
.inquire-form { display: flex; flex-direction: column; gap: var(--space-6); }
.inquire-row { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.inquire-row .field { flex: 1 1 200px; }
.inquire-send { min-height: 44px; padding-inline: 18px; }
.inquire-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.inquire-status { flex: 1 1 200px; margin: 0; font-size: 13px; color: var(--color-accent-300); }
.inquire-form .input[aria-invalid="true"] { border-color: var(--color-accent-300); }
.field-error { margin: 5px 0 0; font-size: 12px; color: var(--color-accent-300); }
.field-error:empty { display: none; }
.inquire-thanks { font-size: 17px; color: var(--color-neutral-200); animation: fadeUp .8s ease both; }

.site-footer {
  padding: 28px clamp(20px, 5vw, 56px) 40px; font-size: 12px; color: var(--color-neutral-400);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* — lightbox — */
.lightbox {
  z-index: 50; overflow: auto;
  background: color-mix(in srgb, var(--color-bg) 86%, transparent);
  backdrop-filter: blur(6px);
}
.lightbox-dialog {
  width: min(940px, 100%); flex-direction: row; flex-wrap: wrap; gap: 28px; padding: 24px;
  animation: fadeUp .45s ease both;
}
.lightbox-stage {
  flex: 1 1 340px; min-height: 300px; max-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); overflow: hidden; background: var(--color-bg);
}
.lightbox-img { width: 100%; height: 100%; max-height: 70vh; object-fit: contain; }
.lightbox-empty { width: 100%; align-self: stretch; min-height: 300px; }
.lightbox-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: var(--space-4); }
.lightbox-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lightbox-series { color: var(--color-accent-300); }
.lightbox-title { margin: 0; }
.lightbox-meta { font-size: 13px; color: var(--color-neutral-400); }
.lightbox-note { font-size: 15px; color: var(--color-neutral-200); margin: var(--space-3) 0 0; text-wrap: pretty; flex: 1; }
.lightbox-actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.lightbox-inquire { margin-left: auto; min-height: 36px; }
html.is-modal-open { overflow: hidden; }

/* Phone width: the brand takes its own line so the links and the lock
   button share the next one instead of wrapping one by one. */
@media (max-width: 480px) {
  .site-brand { flex-basis: 100%; }
  .site-nav .btn-icon { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
