/* ============================================================================
   Seashell — "bathymetric field journal"
   Deep-water chrome, sea-glass content, nacre-coral accent, aqua bioluminescence.
   ========================================================================== */

:root {
  /* --- surfaces (light content world) --- */
  --sea-glass: oklch(0.975 0.008 210); /* page bg — cool, not cream */
  --surface: oklch(0.995 0.003 210); /* cards */
  --surface-2: oklch(0.955 0.011 208); /* insets, skeletons */
  --surface-sink: oklch(0.93 0.014 206); /* pressed / wells */

  /* --- deep world (chrome) --- */
  --abyss: oklch(0.23 0.045 224);
  --abyss-deep: oklch(0.17 0.04 226);
  --abyss-line: oklch(0.4 0.05 220 / 0.5);
  --on-abyss: oklch(0.96 0.012 210);
  --on-abyss-dim: oklch(0.74 0.02 215);

  /* --- ink --- */
  --ink: oklch(0.26 0.03 232);
  --ink-2: oklch(0.44 0.025 232);
  --ink-3: oklch(0.57 0.022 230);
  --ink-faint: oklch(0.7 0.018 228);

  /* --- accent: nacre coral --- */
  --coral: oklch(0.7 0.15 42);
  --coral-strong: oklch(0.6 0.16 39); /* text/borders on light */
  --coral-soft: oklch(0.93 0.05 46);
  --on-coral: oklch(0.99 0.01 60);

  /* --- highlight: bioluminescent aqua --- */
  --aqua: oklch(0.78 0.13 195);
  --aqua-deep: oklch(0.55 0.1 200);

  /* --- primary action = deepened teal --- */
  --btn: oklch(0.3 0.055 222);
  --btn-hover: oklch(0.35 0.06 222);
  --btn-press: oklch(0.26 0.05 222);

  /* --- semantic --- */
  --danger: oklch(0.56 0.19 24);
  --danger-soft: oklch(0.95 0.04 30);
  --good: oklch(0.62 0.13 155);
  --gold: oklch(0.75 0.13 78);

  /* --- lines --- */
  --border: oklch(0.9 0.012 220);
  --border-strong: oklch(0.84 0.016 220);
  --ring: var(--aqua-deep);

  /* --- type --- */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- shape --- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  /* --- elevation (cool-tinted, never pure black) --- */
  --shadow-1: 0 1px 2px oklch(0.3 0.04 225 / 0.06), 0 1px 3px oklch(0.3 0.04 225 / 0.05);
  --shadow-2: 0 4px 12px oklch(0.3 0.04 225 / 0.08), 0 2px 4px oklch(0.3 0.04 225 / 0.05);
  --shadow-3: 0 18px 44px oklch(0.28 0.04 225 / 0.16), 0 6px 14px oklch(0.28 0.04 225 / 0.09);
  --shadow-coral: 0 6px 22px oklch(0.7 0.15 42 / 0.32);

  /* --- motion --- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1); /* ease-out-quart-ish */
  --ease-in: cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --dur: 200ms;

  /* --- z-scale --- */
  --z-nav: 40;
  --z-backdrop: 60;
  --z-dialog: 70;
  --z-toast: 90;

  --edge: max(1.25rem, env(safe-area-inset-left));
  --maxw: 1240px;
}

/* ------------------------------------------------------------------ reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--sea-glass);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink);
  font-optical-sizing: auto;
}

/* accessibility scaffolding */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--abyss);
  color: var(--on-abyss);
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
}
:focus-visible {
  outline: 2.5px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.icon {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.02em;
}

/* ============================================================ TOP NAV ==== */
.topnav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: color-mix(in oklab, var(--abyss) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  color: var(--on-abyss);
  border-bottom: 1px solid var(--abyss-line);
}
.topnav__bar {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.7rem var(--edge);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--on-abyss);
}
.brand .icon {
  width: 1.55rem;
  height: 1.55rem;
  stroke: var(--coral);
  filter: drop-shadow(0 0 10px oklch(0.7 0.15 42 / 0.45));
}
.brand:hover .icon {
  animation: shell-turn 0.7s var(--ease);
}
@keyframes shell-turn {
  50% {
    transform: rotate(-12deg) scale(1.08);
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--on-abyss-dim);
  font-weight: 500;
  font-size: 0.94rem;
  position: relative;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-links a .icon {
  width: 1.15rem;
  height: 1.15rem;
}
.nav-links a:hover {
  color: var(--on-abyss);
  background: oklch(1 0 0 / 0.06);
}
.nav-links a.is-active {
  color: var(--on-abyss);
}
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: -0.72rem;
  height: 2.5px;
  border-radius: 3px;
  background: var(--coral);
  box-shadow: 0 0 10px oklch(0.7 0.15 42 / 0.6);
}
.nav-spacer {
  flex: 1;
}

/* avatar menu */
.usermenu {
  position: relative;
}
.avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.28rem 0.28rem 0.85rem;
  border: 1px solid oklch(1 0 0 / 0.14);
  background: oklch(1 0 0 / 0.05);
  border-radius: 999px;
  cursor: pointer;
  color: var(--on-abyss);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.avatar-btn:hover {
  background: oklch(1 0 0 / 0.11);
  border-color: oklch(1 0 0 / 0.24);
}
.avatar-btn__name {
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--surface-2);
  object-fit: cover;
  border: 1.5px solid oklch(1 0 0 / 0.2);
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  min-width: 15rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: 0.4rem;
  transform-origin: top right;
  animation: pop var(--dur) var(--ease);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
}
.menu__head {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}
.menu__head strong {
  display: block;
  font-family: var(--font-display);
}
.menu__head span {
  font-size: 0.82rem;
  color: var(--ink-3);
}
.menu button,
.menu a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.92rem;
  text-align: left;
  color: var(--ink);
  transition: background var(--dur) var(--ease);
}
.menu button:hover,
.menu a:hover {
  background: var(--surface-2);
}
.menu .danger {
  color: var(--danger);
}
.menu .danger:hover {
  background: var(--danger-soft);
}

/* mobile nav toggle */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: oklch(1 0 0 / 0.06);
  border: 1px solid oklch(1 0 0 / 0.14);
  color: var(--on-abyss);
  border-radius: var(--r-sm);
  padding: 0.5rem;
  cursor: pointer;
}

/* ============================================================ BUTTONS ==== */
.btn {
  --bg: var(--btn);
  --fg: var(--on-abyss);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur);
}
.btn:hover {
  background: var(--btn-hover);
}
.btn:active {
  transform: scale(0.97);
  background: var(--btn-press);
}
.btn .icon {
  width: 1.15rem;
  height: 1.15rem;
}
.btn--coral {
  --bg: var(--coral);
  --fg: var(--on-coral);
  box-shadow: var(--shadow-coral);
}
.btn--coral:hover {
  --bg: oklch(0.66 0.16 41);
}
.btn--coral:active {
  --bg: var(--coral-strong);
}
.btn--ghost {
  --bg: transparent;
  --fg: var(--ink);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  --bg: var(--surface-2);
  border-color: var(--ink-faint);
}
.btn--ghost:active {
  --bg: var(--surface-sink);
}
.btn--danger {
  --bg: transparent;
  --fg: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 40%, transparent);
}
.btn--danger:hover {
  --bg: var(--danger-soft);
}
.btn--sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.86rem;
}
.btn--lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}
.btn--full {
  width: 100%;
}
.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn__spin {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  border: 2px solid color-mix(in oklab, currentColor 35%, transparent);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}
.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.iconbtn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* ================================================= layout & sections ==== */
.view:focus {
  outline: none;
}
.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--edge);
}
.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}
.section__head h1,
.section__head h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
}
.section__head p {
  color: var(--ink-3);
  margin-top: 0.4rem;
  max-width: 52ch;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--coral-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.tideline {
  height: 1px;
  border: 0;
  background: linear-gradient(
    to right,
    transparent,
    var(--coral) 20%,
    var(--coral) 80%,
    transparent
  );
  opacity: 0.4;
  margin-block: 0;
}
.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--aqua);
  box-shadow: 0 0 0 0 oklch(0.78 0.13 195 / 0.6);
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 oklch(0.78 0.13 195 / 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px oklch(0.78 0.13 195 / 0);
  }
}

/* ==================================================== bathymetry motif === */
.bathymetry {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.bathymetry svg {
  position: absolute;
  width: 140%;
  height: 140%;
  top: -20%;
  left: -20%;
  stroke: var(--aqua);
  fill: none;
  opacity: 0.16;
  stroke-width: 1;
}
.bathymetry svg path {
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  to {
    transform: translate3d(2%, -1.5%, 0);
  }
}

/* ================================================================ AUTH === */
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--abyss);
  color: var(--on-abyss);
}
.auth__hero {
  position: relative;
  padding: clamp(2rem, 5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(
      120% 90% at 15% 10%,
      oklch(0.3 0.06 225) 0%,
      transparent 55%
    ),
    linear-gradient(180deg, var(--abyss), var(--abyss-deep));
  overflow: hidden;
}
.auth__brand {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.auth__brand .icon {
  width: 1.9rem;
  height: 1.9rem;
  stroke: var(--coral);
}
.auth__pitch {
  position: relative;
  z-index: 1;
  max-width: 30ch;
}
.auth__pitch h1 {
  color: var(--on-abyss);
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.auth__pitch h1 em {
  font-style: italic;
  color: var(--coral);
}
.auth__pitch p {
  margin-top: 1.1rem;
  color: var(--on-abyss-dim);
  font-size: 1.1rem;
  max-width: 34ch;
}
.auth__meta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.auth__meta div {
  display: flex;
  flex-direction: column;
}
.auth__meta b {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
.auth__meta span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-abyss-dim);
}

.auth__panel {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--sea-glass);
  color: var(--ink);
}
.authcard {
  width: min(30rem, 100%);
}
.authcard h2 {
  font-size: 1.9rem;
}
.authcard > p {
  color: var(--ink-3);
  margin-top: 0.35rem;
  margin-bottom: 1.6rem;
}
.tabs {
  display: inline-flex;
  padding: 0.28rem;
  background: var(--surface-2);
  border-radius: 999px;
  margin-bottom: 1.5rem;
  gap: 0.2rem;
}
.tabs button {
  border: 0;
  background: none;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-3);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ================================================================ FORMS == */
.field {
  margin-bottom: 1.05rem;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 0.4rem;
}
.field label .req {
  color: var(--coral-strong);
}
.field .hint {
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-top: 0.35rem;
}
.input,
.textarea,
.select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  color: var(--ink);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--ink-faint);
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--aqua-deep);
  box-shadow: 0 0 0 3px oklch(0.55 0.1 200 / 0.18);
}
.textarea {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.5;
}
.input-pw {
  position: relative;
}
.input-pw button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 600;
}
.input-pw button:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.switch:has(input:focus-visible) {
  border-color: var(--aqua-deep);
}
.switch input {
  position: absolute;
  opacity: 0;
}
.switch__track {
  width: 2.6rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  flex: none;
  transition: background var(--dur) var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track {
  background: var(--coral);
}
.switch input:checked + .switch__track::after {
  transform: translateX(1.1rem);
}
.switch__label b {
  display: block;
  font-size: 0.92rem;
}
.switch__label span {
  font-size: 0.8rem;
  color: var(--ink-3);
}
.form-error {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--danger-soft);
  border: 1px solid color-mix(in oklab, var(--danger) 30%, transparent);
  color: color-mix(in oklab, var(--danger) 80%, black);
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.form-error .icon {
  flex: none;
  margin-top: 1px;
}
.linkish {
  background: none;
  border: 0;
  color: var(--coral-strong);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
}
.linkish:hover {
  text-decoration: underline;
}
.form-foot {
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =============================================================== FEED ==== */
.reef-hero {
  position: relative;
  background: linear-gradient(180deg, var(--abyss), var(--abyss-deep));
  color: var(--on-abyss);
  overflow: hidden;
  border-bottom: 1px solid var(--abyss-line);
}
.reef-hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--edge) clamp(2.2rem, 5vw, 3.5rem);
}
.reef-hero h1 {
  color: var(--on-abyss);
  font-size: clamp(2.4rem, 6vw, 4rem);
  max-width: 16ch;
}
.reef-hero h1 em {
  font-style: italic;
  color: var(--coral);
}
.reef-hero p {
  margin-top: 1rem;
  color: var(--on-abyss-dim);
  font-size: 1.1rem;
  max-width: 46ch;
}
.reef-hero__row {
  margin-top: 1.8rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 1.4rem;
}
.grid--users {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* shell tile */
.shell {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.shell:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
  border-color: var(--border-strong);
}
.shell:focus-visible {
  outline: 2.5px solid var(--ring);
  outline-offset: 2px;
}
.shell__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}
.shell__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.shell:hover .shell__media img {
  transform: scale(1.05);
}
.shell__cat {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  background: oklch(0.17 0.04 226 / 0.72);
  color: var(--on-abyss);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.shell__lock {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: oklch(0.17 0.04 226 / 0.72);
  color: var(--on-abyss);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.shell__lock .icon {
  width: 0.9rem;
  height: 0.9rem;
}
.shell__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.shell__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.15;
}
.shell__note {
  color: var(--ink-3);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shell__foot {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.shell__owner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.shell__owner .avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-color: var(--border);
}
.shell__owner span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell__loc {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.shell__loc .icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--coral-strong);
}

/* image fallback placeholder */
.ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 50% 0%, var(--surface-2), var(--surface-sink));
  color: var(--ink-faint);
}
.ph .icon {
  width: 2.4rem;
  height: 2.4rem;
  opacity: 0.5;
}
.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-radial-gradient(
    circle at 30% 120%,
    transparent 0 16px,
    oklch(0.55 0.1 200 / 0.09) 16px 17px
  );
}

/* ================================================= shell detail ========= */
.detail {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.detail__media {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--border);
}
.detail__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail__aside {
  position: sticky;
  top: 5.5rem;
}
.detail h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-top: 0.5rem;
}
.detail__note {
  font-size: 1.08rem;
  color: var(--ink-2);
  line-height: 1.65;
  margin-top: 1.1rem;
  max-width: 60ch;
  text-wrap: pretty;
}
.specsheet {
  margin-top: 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.specsheet__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.05rem;
  border-bottom: 1px solid var(--border);
}
.specsheet__row:last-child {
  border-bottom: 0;
}
.specsheet__row dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.specsheet__row dd {
  font-size: 0.92rem;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}
.detail__owner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.detail__owner:hover {
  background: var(--surface-2);
}
.detail__owner .avatar {
  width: 2.75rem;
  height: 2.75rem;
}
.detail__owner b {
  font-family: var(--font-display);
}
.detail__owner span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-3);
}
.detail__actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

/* ================================================= profile ============== */
.profile-head {
  position: relative;
  background: linear-gradient(180deg, var(--abyss), var(--abyss-deep));
  color: var(--on-abyss);
  overflow: hidden;
  border-bottom: 1px solid var(--abyss-line);
}
.profile-head__inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 3.5rem) var(--edge);
  display: flex;
  gap: 1.8rem;
  align-items: center;
  flex-wrap: wrap;
}
.profile-head .avatar {
  width: 6rem;
  height: 6rem;
  border-width: 3px;
  border-color: oklch(1 0 0 / 0.18);
  box-shadow: var(--shadow-2);
}
.profile-id {
  flex: 1;
  min-width: 15rem;
}
.profile-id h1 {
  color: var(--on-abyss);
  font-size: clamp(2rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.profile-id__user {
  font-family: var(--font-mono);
  color: var(--aqua);
  font-size: 0.95rem;
}
.profile-id__bio {
  color: var(--on-abyss-dim);
  margin-top: 0.7rem;
  max-width: 60ch;
}
.badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid oklch(1 0 0 / 0.16);
  background: oklch(1 0 0 / 0.07);
  color: var(--on-abyss);
}
.badge .icon {
  width: 0.95rem;
  height: 0.95rem;
}
.badge--verified {
  color: var(--aqua);
  border-color: color-mix(in oklab, var(--aqua) 40%, transparent);
}
.badge--verified .icon {
  fill: color-mix(in oklab, var(--aqua) 24%, transparent);
}
.badge--plan {
  color: var(--coral);
  border-color: color-mix(in oklab, var(--coral) 45%, transparent);
  text-transform: capitalize;
}
.badge--role {
  color: var(--gold);
  border-color: color-mix(in oklab, var(--gold) 45%, transparent);
}
.profile-stats {
  display: flex;
  gap: 2.2rem;
  flex-wrap: wrap;
}
.stat b {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  display: block;
  color: var(--on-abyss);
}
.stat span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-abyss-dim);
}

/* ================================================= explorers =========== */
.ucard {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.6rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.ucard:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
}
.ucard:focus-visible {
  outline: 2.5px solid var(--ring);
  outline-offset: 2px;
}
.ucard .avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-color: var(--border);
}
.ucard b {
  font-family: var(--font-display);
  font-size: 1.12rem;
}
.ucard__user {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-3);
}
.ucard__bio {
  font-size: 0.85rem;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ucard__badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.3rem;
}
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-transform: capitalize;
}
.tag--verified {
  color: var(--aqua-deep);
  background: oklch(0.78 0.13 195 / 0.14);
}

/* ================================================= dialog ============== */
.dialog {
  border: 0;
  padding: 0;
  border-radius: var(--r-xl);
  max-width: 36rem;
  width: calc(100% - 2rem);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  overflow: visible;
}
.dialog::backdrop {
  background: oklch(0.16 0.04 226 / 0.55);
  backdrop-filter: blur(3px);
}
.dialog[open] {
  animation: dialog-in 0.26s var(--ease);
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
.dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.5rem 0;
}
.dialog__head h2 {
  font-size: 1.5rem;
}
.dialog__head p {
  color: var(--ink-3);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}
.dialog__body {
  padding: 1.2rem 1.5rem 1.5rem;
}
.dialog form {
  margin-top: 0.4rem;
}

/* ================================================= states ============== */
.skeleton {
  background: linear-gradient(
    100deg,
    var(--surface-2) 30%,
    var(--surface-sink) 50%,
    var(--surface-2) 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.sk-shell {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.sk-shell__media {
  aspect-ratio: 4 / 3;
}
.sk-shell__body {
  padding: 1rem 1.1rem 1.2rem;
  display: grid;
  gap: 0.6rem;
}
.sk-line {
  height: 0.85rem;
  border-radius: 5px;
}

.empty,
.errbox {
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  max-width: 34rem;
  margin-inline: auto;
}
.empty__mark {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--coral-strong);
}
.empty__mark .icon {
  width: 2.2rem;
  height: 2.2rem;
}
.empty h2 {
  font-size: 1.6rem;
}
.empty p,
.errbox p {
  color: var(--ink-3);
  margin-top: 0.5rem;
  margin-bottom: 1.4rem;
}
.errbox .empty__mark {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ================================================= toasts ============== */
.toasts {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  right: 1.25rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(24rem, calc(100vw - 2rem));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--abyss);
  color: var(--on-abyss);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  border-left: 3px solid var(--aqua);
  animation: toast-in 0.3s var(--ease);
  font-size: 0.9rem;
}
.toast--error {
  border-left-color: var(--danger);
}
.toast--success {
  border-left-color: var(--good);
}
.toast .icon {
  flex: none;
  margin-top: 1px;
  width: 1.15rem;
  height: 1.15rem;
}
.toast.is-out {
  animation: toast-out 0.25s var(--ease-in) forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* the "reset code" reveal */
.codebox {
  font-family: var(--font-mono);
  background: var(--abyss);
  color: var(--aqua);
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-md);
  letter-spacing: 0.1em;
  word-break: break-all;
  font-size: 0.95rem;
}

/* footer */
.foot {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.foot__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 2rem var(--edge);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: 0.85rem;
}
.foot .brand {
  color: var(--ink);
  font-size: 1.1rem;
}
.foot .brand .icon {
  width: 1.3rem;
  height: 1.3rem;
  filter: none;
}

/* Entrance: content is visible by default; motion is pure enhancement.
   No fill-mode, so a paused/headless render resolves to the base (visible) state
   instead of shipping blank. */
.rise {
  animation: rise 0.5s var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ================================================= responsive ========== */
@media (max-width: 900px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth__hero {
    min-height: 40vh;
  }
  .detail {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .detail__aside {
    position: static;
  }
}
@media (max-width: 720px) {
  .nav-links,
  .avatar-btn__name {
    display: none;
  }
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }
  .topnav.is-open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: var(--abyss-deep);
    padding: 0.6rem var(--edge) 1rem;
    border-bottom: 1px solid var(--abyss-line);
  }
  .topnav.is-open .nav-links a.is-active::after {
    display: none;
  }
  .topnav.is-open .nav-links a.is-active {
    background: oklch(1 0 0 / 0.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .rise {
    opacity: 1;
    transform: none;
  }
}
