/* ESNC Links — warm SORA world: ivory, sand, espresso, one terracotta thread.
   Motion is breath: the aura runs on the same 8s inhale/exhale clock as the store. */

@font-face {
  font-family: 'Jost';
  src: url('../fonts/jost-latin.woff2') format('woff2');
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-italic-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ivory: #F8F5F0;
  --sand: #E5DDD3;
  --sand-soft: #EFE9E1;
  --taupe: #B8AA9A;
  --espresso: #43352C;
  --ink: #2A2A2A;
  --muted: #6B5D52;          /* 5.8:1 on the card */
  --terracotta: #C97756;
  --terracotta-deep: #A85B3C;
  --terracotta-ink: #8E4A2E; /* badge text, 5.8:1 on its tint */
  --terracotta-tint: #F3E4DC;
  --card: rgba(255, 253, 250, 0.84);
  --card-solid: #FFFDFA;
  --line: rgba(67, 53, 44, 0.11);
  --line-strong: rgba(67, 53, 44, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 0.7, 0.18, 1);
  --breath: 8s;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Jost', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ivory);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ivory);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Background: breathing aura ---------- */

.aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.aura::before,
.aura::after {
  content: '';
  position: absolute;
  left: calc(50% - var(--size) / 2);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  animation: breathe var(--breath) ease-in-out infinite;
  will-change: transform, opacity;
}
.aura::before {
  --size: max(150vw, 820px);
  top: -34vh;
  background: radial-gradient(closest-side, rgba(229, 221, 211, 0.95), rgba(229, 221, 211, 0.55) 45%, rgba(229, 221, 211, 0) 100%);
}
.aura::after {
  --size: max(84vw, 460px);
  top: -10vh;
  background: radial-gradient(closest-side, rgba(201, 119, 86, 0.2), rgba(201, 119, 86, 0.07) 55%, rgba(201, 119, 86, 0) 100%);
  animation-name: breathe-warm;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.78; }
  50% { transform: scale(1.03); opacity: 1; }
}
@keyframes breathe-warm {
  0%, 100% { transform: scale(0.9); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* ---------- Page ---------- */

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(40px, calc(env(safe-area-inset-top) + 28px)) 16px max(36px, calc(env(safe-area-inset-bottom) + 24px));
}

.share {
  position: absolute;
  top: max(14px, calc(env(safe-area-inset-top) + 8px));
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.6);
  color: var(--espresso);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.share svg { width: 19px; height: 19px; stroke-width: 1.7; }

/* ---------- Profile ---------- */

.profile {
  --mark-w: min(272px, 70vw);
  text-align: center;
}
.profile > * {
  animation: rise 0.9s var(--ease) both;
}

/* Hero monogram: full ink at the crown, dissolving downward so the wordmark
   and tagline sit on its fading lower third. */
.profile__mark {
  display: block;
  width: var(--mark-w);
  height: auto;
  margin: 0 auto;
  opacity: 0.92;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 18%, rgba(0, 0, 0, 0.55) 42%, rgba(0, 0, 0, 0.18) 62%, rgba(0, 0, 0, 0.06) 80%, transparent 94%);
  mask-image: linear-gradient(to bottom, #000 18%, rgba(0, 0, 0, 0.55) 42%, rgba(0, 0, 0, 0.18) 62%, rgba(0, 0, 0, 0.06) 80%, transparent 94%);
  animation: mark-in 1.6s var(--ease) both;
}
@supports not ((-webkit-mask-image: linear-gradient(#000, #000)) or (mask-image: linear-gradient(#000, #000))) {
  .profile__mark { opacity: 0.18; }
}
@keyframes mark-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
}

.profile__name {
  position: relative;
  z-index: 1;
  /* Pull the wordmark up onto the monogram's lower third (0.49 ≈ 0.38 × 694/537). */
  margin: calc(var(--mark-w) * -0.49) 0 0;
  line-height: 0;
  animation-delay: 0.35s;
}
.profile__name img {
  width: auto;
  height: auto;
  max-width: min(176px, 46vw);
  max-height: 96px;
  margin: 0 auto;
  /* Ivory halo lifts the wordmark off the monogram lines behind it. */
  filter: drop-shadow(0 0 8px rgba(248, 245, 240, 0.95)) drop-shadow(0 0 18px rgba(248, 245, 240, 0.7));
}
.profile__bio {
  position: relative;
  z-index: 1;
  margin: 20px 0 0;
  color: var(--espresso);
  font: italic 500 clamp(22px, 6vw, 25px)/1.2 var(--font-display);
  letter-spacing: 0.005em;
  text-shadow: 0 0 10px rgba(248, 245, 240, 0.95), 0 0 22px rgba(248, 245, 240, 0.8);
  animation-delay: 0.45s;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  animation-delay: 0.55s;
}
.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.6);
  color: var(--espresso);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.social svg { width: 20px; height: 20px; stroke-width: 1.6; }

/* ---------- Links ---------- */

.links {
  display: grid;
  gap: 12px;
  margin-top: 34px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 12px 30px -24px rgba(67, 53, 44, 0.5);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}

.link__media {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--sand-soft);
  color: var(--espresso);
}
.link__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.link__media svg { width: 24px; height: 24px; stroke-width: 1.6; }
.link__media .emoji { font-size: 26px; line-height: 1; }

.link__body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.link__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ink);
  font: 500 16px/1.3 var(--font-body);
  letter-spacing: 0.005em;
}
.link__desc {
  color: var(--muted);
  font: 400 13.5px/1.45 var(--font-body);
}
.link__go {
  flex: none;
  width: 19px;
  height: 19px;
  color: var(--taupe);
  stroke-width: 1.8;
  transition: transform 0.4s var(--ease), color 0.4s var(--ease);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--terracotta-tint);
  color: var(--terracotta-ink);
  font: 500 10.5px/1 var(--font-body);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Featured link with a picture: image on top, serif title below. */
.link--feature {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 8px;
}
.link--feature .link__media {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: calc(var(--radius) - 6px);
}
.link--feature .link__media img {
  transition: transform 1.4s var(--ease);
}
.link--feature .link__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px 8px;
}
.link--feature .link__body { gap: 6px; }
.link--feature .badge { justify-self: start; }
.link--feature .link__title {
  font: 600 25px/1.1 var(--font-display);
  letter-spacing: 0;
}

/* Featured link without a picture: the one dark card on the page. */
.link--dark {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 16px 34px -22px rgba(42, 42, 42, 0.8);
}
.link--dark .link__title { color: var(--ivory); }
.link--dark .link__desc { color: rgba(248, 245, 240, 0.74); }
.link--dark .link__media { background: rgba(248, 245, 240, 0.09); color: var(--ivory); }
.link--dark .link__go { color: rgba(248, 245, 240, 0.6); }
.link--dark .badge { background: rgba(218, 155, 126, 0.2); color: #F4CBB6; }

.heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 4px 2px;
  color: var(--espresso);
  font: 600 21px/1.2 var(--font-display);
}
.heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.empty {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font: italic 500 20px/1.3 var(--font-display);
}

/* Loading placeholders, replaced on the first render. */
.skeleton {
  height: 76px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(229, 221, 211, 0.5) 30%, rgba(255, 253, 250, 0.9) 50%, rgba(229, 221, 211, 0.5) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.6s linear infinite;
}
.skeleton--feature { height: 300px; }
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* ---------- Interaction ---------- */

@media (hover: hover) {
  .link:hover {
    border-color: var(--line-strong);
    background: var(--card-solid);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 20px 38px -26px rgba(67, 53, 44, 0.6);
    transform: translateY(-2px);
  }
  .link:hover .link__go { color: var(--terracotta-deep); transform: translate(2px, -2px); }
  .link--feature:hover .link__media img { transform: scale(1.035); }
  .link--dark:hover { background: #1F1F1F; border-color: #1F1F1F; }
  .link--dark:hover .link__go { color: var(--ivory); }
  .social:hover,
  .share:hover {
    border-color: var(--line-strong);
    background: var(--card-solid);
    color: var(--ink);
    transform: translateY(-1px);
  }
}
.link:active { transform: scale(0.985); transition-duration: 0.12s; }
.social:active,
.share:active { transform: scale(0.94); transition-duration: 0.12s; }

.link:focus-visible,
.social:focus-visible,
.share:focus-visible,
.foot a:focus-visible {
  outline: 2px solid var(--terracotta-deep);
  outline-offset: 3px;
}

/* ---------- Entrance ---------- */

.is-entering .link,
.is-entering .heading,
.is-entering .empty {
  animation: rise 0.75s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms + 120ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

/* ---------- Footer, toast, status ---------- */

.foot {
  margin-top: 44px;
  text-align: center;
  color: var(--muted);
  font: 400 12.5px/1.7 var(--font-body);
  letter-spacing: 0.02em;
}
.foot a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 10;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ivory);
  font: 500 13.5px/1.2 var(--font-body);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.status {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 9;
  max-width: 496px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card-solid);
  color: var(--espresso);
  font: 400 12.5px/1.45 var(--font-body);
  box-shadow: 0 12px 30px -18px rgba(67, 53, 44, 0.5);
}
.status b { font-weight: 500; }
.status.is-error { border-color: var(--terracotta); }

@media (min-width: 720px) {
  .page { padding-top: 56px; }
  .share { top: 24px; }
}

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