/* ============================================================
   Taylor Satterfield, personal hub
   Palette: Ember (warm espresso + amber), authored in OKLCH.
   Two first-class themes. Warm neutrals, one amber accent.
   ============================================================ */

/* Self-hosted fonts. Inter is a variable font (one file, all weights). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-var.woff2") format("woff2");
}
@font-face {
  font-family: "Calistoga";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/calistoga-400.woff2") format("woff2");
}

/* ---- Dark (default): warm espresso, evening light ---- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: oklch(19% 0.011 61);
  --bg-glow: oklch(30% 0.05 68);
  --surface: oklch(24.5% 0.014 63);
  --surface-hover: oklch(28% 0.018 64);
  --border: oklch(32% 0.018 64);
  --border-strong: oklch(40% 0.022 66);

  --ink: oklch(93.7% 0.019 80);
  --ink-muted: oklch(72% 0.028 76);
  --ink-faint: oklch(58% 0.026 72);

  --accent: oklch(78% 0.135 72);
  --accent-strong: oklch(72% 0.15 66);
  --accent-tint: oklch(30% 0.05 66);
  --on-accent: oklch(22% 0.02 60);

  --ring: oklch(80% 0.13 74);
  --shadow: oklch(12% 0.02 60 / 0.55);
  --tile-icon: oklch(82% 0.03 78);
}

/* ---- Light: warm paper, daylight ---- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: oklch(95.5% 0.014 85);
  --bg-glow: oklch(90% 0.05 78);
  --surface: oklch(99% 0.008 85);
  --surface-hover: oklch(97% 0.012 84);
  --border: oklch(87% 0.016 80);
  --border-strong: oklch(80% 0.02 76);

  --ink: oklch(26% 0.021 66);
  --ink-muted: oklch(45% 0.026 70);
  --ink-faint: oklch(58% 0.026 72);

  --accent: oklch(60% 0.13 58);
  --accent-strong: oklch(54% 0.14 52);
  --accent-tint: oklch(92% 0.04 78);
  --on-accent: oklch(99% 0.01 85);

  --ring: oklch(58% 0.13 56);
  --shadow: oklch(50% 0.03 60 / 0.16);
  --tile-icon: oklch(45% 0.05 66);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  /* A single warm glow up top. Not a gradient wash, just ambient light. */
  background-image: radial-gradient(
    120% 60% at 50% -10%,
    var(--bg-glow) 0%,
    transparent 60%
  );
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Accessibility helpers ------------------------------------ */

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -140%);
  z-index: 50;
  padding: 0.6rem 1rem;
  border-radius: 0 0 0.6rem 0.6rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease;
}
.skip-link:focus {
  transform: translate(-50%, 0);
}

:where(a, button):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

/* Layout --------------------------------------------------- */

.page {
  width: min(100% - 2rem, 32rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 10vh, 6rem) 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

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

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
  margin-bottom: 1.35rem;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px -14px var(--shadow);
}

.avatar--monogram {
  display: grid;
  place-items: center;
  font-family: "Calistoga", Georgia, serif;
  font-size: 2.1rem;
  color: var(--accent);
  background: var(--accent-tint);
  border-color: var(--border-strong);
  letter-spacing: 0.01em;
}

.profile__handle {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.profile__name {
  margin: 0;
  font-family: "Calistoga", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 8vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.profile__bio {
  margin: 0;
  max-width: 30ch;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* Section eyebrow ------------------------------------------ */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: -0.9rem;
  color: var(--ink-faint);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Link rows ------------------------------------------------ */

.links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.link {
  --lift: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 0 var(--shadow);
  transition:
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 240ms ease,
    background-color 240ms ease,
    box-shadow 240ms ease;
  transform: translateY(var(--lift));
}

.link:hover {
  --lift: -2px;
  background: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: 0 16px 34px -20px var(--shadow);
}
.link:active {
  --lift: 0px;
}

.link__tile {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--tile-icon);
  transition: color 240ms ease, background-color 240ms ease, border-color 240ms ease;
}
.link:hover .link__tile {
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 45%, var(--border));
}
.link__tile svg {
  width: 20px;
  height: 20px;
}
.link__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Frame the emblem: lift past the white margins, drop the wordmark. */
  transform: scale(1.55) translateY(13%);
}
/* A logo tile is a clean white chip so the mark's own background reads as
   intentional in both themes, not a stray white square. */
.link__tile:has(.link__logo) {
  background: #fbf8f3;
  border-color: color-mix(in oklch, var(--border-strong) 55%, transparent);
}

.link__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.link__label {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.005em;
}
.link__desc {
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.link__chevron {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--ink-faint);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), color 240ms ease;
}
.link__chevron svg {
  width: 18px;
  height: 18px;
  display: block;
}
.link:hover .link__chevron {
  color: var(--accent);
  transform: translateX(3px);
}

/* The one primary link. Amber earns its keep here: an ember-lit card. */
.link--featured {
  border-color: color-mix(in oklch, var(--accent) 62%, var(--border));
  background:
    radial-gradient(
      130% 150% at 0% 0%,
      color-mix(in oklch, var(--accent) 24%, transparent),
      transparent 62%
    ),
    color-mix(in oklch, var(--accent-tint) 62%, var(--surface));
}
.link--featured .link__tile {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.link--featured .link__chevron {
  color: var(--accent-strong);
}
.link--featured:hover {
  border-color: var(--accent);
}

/* A soft amber halo behind the primary link, breathing to catch the eye. */
.link--featured::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 38px -2px color-mix(in oklch, var(--accent) 68%, transparent);
  opacity: 0.28;
}

/* Hero card: a big primary link that leads with a preview image ---- */

.link--hero {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

.hero__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--accent-tint);
}
.hero__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.link--hero:hover .hero__img {
  transform: scale(1.03);
}

/* The label + badge + chevron bar beneath the preview. */
.hero__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  border-top: 1px solid var(--border);
}
.link--hero.link--featured .hero__bar {
  border-top-color: color-mix(in oklch, var(--accent) 40%, var(--border));
}

/* Featured glow: overflow is clipped on the card, so redraw the halo as an
   inset ring that survives the clip and still breathes. */
.link--hero.link--featured::after {
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent) 45%, transparent);
}

@media (min-width: 540px) {
  .hero__bar {
    padding-inline: 1.35rem;
  }
}

/* Attention badge ------------------------------------------ */

.link__titlerow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.link__titlerow .link__label {
  overflow-wrap: anywhere;
}

.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  white-space: nowrap;
}
.badge--soft {
  color: var(--accent);
  background: var(--accent-tint);
}
.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

@media (prefers-reduced-motion: no-preference) {
  .link--featured::after {
    animation: halo 3.2s ease-in-out infinite;
  }
  @keyframes halo {
    0%,
    100% {
      opacity: 0.24;
    }
    50% {
      opacity: 0.85;
    }
  }
  .badge__dot {
    animation: livedot 1.8s ease-in-out infinite;
  }
  @keyframes livedot {
    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }
    50% {
      opacity: 0.35;
      transform: scale(0.65);
    }
  }
}

/* Socials -------------------------------------------------- */

.socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.socials li {
  display: flex;
}
.social {
  --lift: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
  padding: 0.85rem 1.15rem;
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  box-shadow: 0 1px 0 var(--shadow);
  transition:
    color 240ms ease,
    background-color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateY(var(--lift));
}
.social:hover {
  --lift: -2px;
  background: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: 0 16px 34px -20px var(--shadow);
}
.social:active {
  --lift: 0px;
}
.social__icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--tile-icon);
  transition: color 240ms ease, background-color 240ms ease, border-color 240ms ease;
}
.social:hover .social__icon {
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 45%, var(--border));
}
.social__icon svg {
  width: 20px;
  height: 20px;
}
.social__label {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* Footer --------------------------------------------------- */

.footer {
  margin-top: 1.35rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.78rem;
  line-height: 1.6;
}
.footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-strong);
}
.footer a:hover {
  color: var(--accent);
}

/* Control buttons (share + theme) -------------------------- */

.controls {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 40;
  display: flex;
  gap: 0.5rem;
}
.iconbtn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink-muted);
  background: color-mix(in oklch, var(--surface) 70%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: color 200ms ease, background-color 200ms ease, transform 200ms ease;
}
.iconbtn:hover {
  color: var(--accent);
}
#theme-toggle:hover {
  transform: rotate(-12deg);
}
#share-btn:hover {
  transform: translateY(-1px);
}
.iconbtn svg {
  width: 20px;
  height: 20px;
}

/* Status pill ---------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.8rem;
}
.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(72% 0.17 150);
  box-shadow: 0 0 0 0 oklch(72% 0.17 150 / 0.5);
}
@media (prefers-reduced-motion: no-preference) {
  .status__dot {
    animation: ping 2s ease-out infinite;
  }
  @keyframes ping {
    0% {
      box-shadow: 0 0 0 0 oklch(72% 0.17 150 / 0.5);
    }
    70%,
    100% {
      box-shadow: 0 0 0 7px oklch(72% 0.17 150 / 0);
    }
  }
}

/* Section headings (when links are grouped) ---------------- */

.eyebrow + .link {
  margin-top: 0;
}
.eyebrow:not(:first-child) {
  margin-top: 0.6rem;
}

/* Newsletter ----------------------------------------------- */

.subscribe:empty {
  display: none;
}
.subscribe {
  padding: 1.35rem 1.35rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}
.subscribe__title {
  margin: 0 0 0.25rem;
  font-family: "Calistoga", Georgia, serif;
  font-weight: 400;
  font-size: 1.25rem;
}
.subscribe__sub {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.subscribe__form {
  display: flex;
  gap: 0.5rem;
}
.subscribe__input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.subscribe__input::placeholder {
  color: var(--ink-faint);
}
.subscribe__btn {
  flex-shrink: 0;
  height: 46px;
  padding: 0 1.1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  transition: filter 160ms ease, transform 160ms ease;
}
.subscribe__btn:hover {
  filter: brightness(1.06);
}
.subscribe__btn:active {
  transform: translateY(1px);
}
.subscribe__btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.subscribe__msg {
  margin: 0.75rem 0 0;
  min-height: 1.1em;
  font-size: 0.85rem;
  color: var(--accent);
}

/* Share modal ---------------------------------------------- */

.modal[hidden] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: color-mix(in oklch, oklch(12% 0.02 60) 55%, transparent);
  backdrop-filter: blur(3px);
}
.modal__card {
  width: min(100%, 22rem);
  padding: 1.75rem;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 30px 60px -24px var(--shadow);
  text-align: center;
}
.modal__title {
  margin: 0 0 1rem;
  font-family: "Calistoga", Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
}
.modal__qr {
  width: 190px;
  height: 190px;
  margin: 0 auto 1rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: #fff;
}
.modal__qr img {
  width: 100%;
  height: 100%;
  display: block;
}
.modal__url {
  display: block;
  margin-bottom: 1rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  word-break: break-all;
}
.modal__actions {
  display: flex;
  gap: 0.5rem;
}
.modal__btn {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  transition: border-color 160ms ease, color 160ms ease;
}
.modal__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.modal__btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.modal__btn--primary:hover {
  color: var(--on-accent);
  filter: brightness(1.06);
}

@media (prefers-reduced-motion: no-preference) {
  .modal {
    animation: fade 180ms ease-out;
  }
  .modal__card {
    animation: pop 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes fade {
    from {
      opacity: 0;
    }
  }
  @keyframes pop {
    from {
      opacity: 0;
      transform: translateY(8px) scale(0.98);
    }
  }
}

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

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--delay, 0ms);
  }
  @keyframes rise {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Wider screens: a touch more breathing room, still one column. */
@media (min-width: 540px) {
  .link,
  .social {
    padding-inline: 1.35rem;
  }
}
