@font-face {
  font-family: KaramahSans;
  src: url('/assets/general-sans.woff2') format('woff2');
  font-weight: 200 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f1efe7;
  --surface: #fffdf8;
  --ink: #202923;
  --accent: #2b745c;
  --content-width: 680px;
  --muted: color-mix(in srgb, var(--ink) 62%, transparent);
  --faint: color-mix(in srgb, var(--ink) 44%, transparent);
  --line: color-mix(in srgb, var(--ink) 10%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 17%, transparent);
  --accent-wash: color-mix(in srgb, var(--accent) 8%, var(--surface));
  --radius-card: 16px;
  --radius-image: 11px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  font-family: KaramahSans, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

:root[data-corners='compact'] { --radius-card: 10px; --radius-image: 7px; }
:root[data-corners='pill'] { --radius-card: 28px; --radius-image: 22px; }
:root[data-theme='dark'] { color-scheme: dark; }
:root[data-theme='system'] { color-scheme: light dark; }

@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] { color-scheme: dark; }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: color-mix(in srgb, var(--canvas) 90%, var(--ink)); }
body {
  min-width: 280px;
  margin: 0;
  background: color-mix(in srgb, var(--canvas) 90%, var(--ink));
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.atmosphere { position: fixed; inset: 0; pointer-events: none; }
.atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .016;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.84' numOctaves='4' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-background='plain'] .atmosphere { display: none; }
:root[data-background='mist'] .atmosphere {
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 32%);
}

.page {
  position: relative;
  width: min(calc(100% - 24px), calc(var(--content-width) + 36px));
  max-width: 756px;
  min-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  margin: 12px auto;
  padding: 16px 18px 24px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  border-radius: 30px;
  background: var(--canvas);
  box-shadow: 0 18px 55px color-mix(in srgb, var(--ink) 8%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 42%, transparent);
}
:root[data-layout='grid'] .page { width: min(calc(100% - 24px), calc(var(--content-width) + 36px)); max-width: 976px; }
.page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 68px;
  height: 2px;
  border-radius: 0 0 999px 999px;
  background: var(--accent);
  opacity: .75;
  transform: translateX(-50%);
}

.masthead {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: reveal 420ms var(--ease-out) both;
}
.brand {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent);
  text-decoration: none;
  transition: transform 150ms var(--ease-out), border-color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}
.brand img { width: 27px; height: 27px; object-fit: contain; }
.round-action {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent);
  transition: transform 150ms var(--ease-out), border-color 180ms var(--ease-out), color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}
.round-action span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.round-action svg { width: 16px; height: 16px; }
.round-action:active { transform: scale(.96); }

.profile-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 27px 16px 22px;
  text-align: center;
  animation: reveal 460ms var(--ease-out) 40ms both;
}
.profile-panel::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  width: 188px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 7%, transparent), transparent 68%);
  pointer-events: none;
  transform: translateX(-50%);
}
.profile-portrait {
  position: relative;
  width: 82px;
  height: 82px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 27px;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}
.portrait-core {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 15px;
  overflow: hidden;
  border-radius: 23px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 75%, transparent);
}
.portrait-core img { width: 100%; height: 100%; object-fit: contain; }
.portrait-orbit {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 19px;
  height: 19px;
  border: 4px solid var(--canvas);
  border-radius: 50%;
  background: var(--accent);
}
.profile-copy { margin-top: 15px; }
.kicker {
  display: block;
  color: var(--accent);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.profile-copy h1 {
  margin: 0;
  font-size: clamp(25px, 5vw, 31px);
  line-height: 1.05;
  font-weight: 630;
  letter-spacing: -.045em;
}
.profile-copy .kicker:not([hidden]) + h1 { margin-top: 7px; }
.profile-copy p {
  max-width: 44ch;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.profile-signature {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
}
.profile-copy[hidden] + .profile-signature { margin-top: 13px; }
.profile-signature i { width: 18px; height: 1px; background: var(--line-strong); }
.profile-signature span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.directory { width: 100%; animation: reveal 480ms var(--ease-out) 80ms both; }
.directory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  padding: 0 3px;
}
.directory-copy { min-width: 0; }
.directory-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: -.025em;
}
.directory-head .kicker:not([hidden]) + h2 { margin-top: 5px; }
.directory-head p {
  max-width: 52ch;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.directory-index {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
}
.directory-index i {
  width: 24px;
  height: 1px;
  background: var(--line-strong);
}
.directory-index strong {
  font-size: 8px;
  font-weight: 620;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.directory-head.is-minimal {
  min-height: 20px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 9px;
}
.directory-head.is-minimal::before {
  content: '';
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, transparent, var(--line));
}

.links { display: grid; gap: 9px; }
:root[data-layout='grid'] .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.link-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--ink) 4%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 60%, transparent);
  opacity: 0;
  animation: card-reveal 380ms var(--ease-out) calc(60ms + var(--index) * 45ms) forwards;
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), background-color 180ms var(--ease-out);
}
.link-card.featured { border-left: 3px solid var(--accent); }
.link-main {
  min-height: 78px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  text-decoration: none;
}
.link-card:has(.link-share) .link-main { padding-right: 47px; }
.link-media {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ink) 5%, transparent);
  border-radius: var(--radius-image);
  background: var(--accent-wash);
}
.link-media img { width: 100%; height: 100%; object-fit: cover; }
:root[data-images='contain'] .link-media img,
.link-media img.is-fallback { padding: 17%; object-fit: contain; }
.featured-label {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 3px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--accent);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 10%, transparent);
}
.link-copy { min-width: 0; }
.link-domain {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.link-domain img { width: 11px; height: 11px; border-radius: 3px; object-fit: contain; }
.link-copy h3 {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 620;
  letter-spacing: -.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-copy p {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-arrow,
.link-share {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--faint);
}
.link-arrow { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.link-arrow svg { width: 13px; height: 13px; }
.link-card:has(.link-share) .link-arrow { display: none; }
.link-share {
  position: absolute;
  right: 10px;
  top: 50%;
  padding: 0;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 150ms var(--ease-out), color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}
.link-share:active { transform: translateY(-50%) scale(.94); }
.link-share span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.link-share svg { width: 14px; height: 14px; }
:root[data-cards='outline'] .link-card { background: color-mix(in srgb, var(--surface) 38%, transparent); box-shadow: none; }
:root[data-cards='solid'] .link-card { border-color: transparent; box-shadow: none; }

.skeleton {
  height: 78px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  overflow: hidden;
}
.skeleton i,
.skeleton span { position: relative; overflow: hidden; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.skeleton i { width: 56px; height: 56px; border-radius: var(--radius-image); }
.skeleton span { height: 24px; max-width: 66%; border-radius: 6px; }
.skeleton i::after,
.skeleton span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, color-mix(in srgb, #fff 50%, transparent), transparent);
  animation: shimmer 1.5s var(--ease-out) infinite;
}
.state {
  padding: 48px 20px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.state-mark {
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 13px;
  border-radius: 50%;
  background: var(--accent-wash);
}
.state strong { display: block; font-size: 14px; }
.state p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.state button {
  margin-top: 16px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms var(--ease-out), filter 180ms var(--ease-out);
}
.state button:active { transform: scale(.97); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: auto;
  padding-top: 56px;
  color: var(--faint);
}
.footer-mark { display: flex; align-items: center; gap: 8px; }
.footer-mark > span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.footer-mark p { margin: 0; font-size: 8px; font-weight: 620; letter-spacing: .1em; text-transform: uppercase; }
.site-footer > a { display: flex; align-items: center; gap: 8px; font-size: 9px; text-decoration: none; }
.site-footer > a i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.site-footer > a svg { width: 12px; height: 12px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 2;
  padding: 10px 15px;
  border: 1px solid color-mix(in srgb, var(--surface) 12%, transparent);
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 10px;
  font-weight: 620;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) scale(.98);
  transition: transform 180ms var(--ease-out), opacity 150ms var(--ease-out);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }

@media (hover: hover) and (pointer: fine) {
  .brand:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--surface); }
  .round-action:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--surface); }
  .link-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 6%, transparent); }
  .link-share:hover { color: var(--accent); background: var(--accent-wash); }
  .site-footer > a:hover { color: var(--accent); }
  .state button:hover { filter: brightness(.94); }
}

@media (max-width: 759px) {
  :root[data-layout='grid'] .links { grid-template-columns: 1fr; }
  .page { width: min(calc(100% - 12px), calc(var(--content-width) + 20px)); min-height: calc(100dvh - 12px); margin: 6px auto; padding: 10px 10px 20px; border-radius: 24px; }
  .profile-panel { padding: 22px 12px 20px; }
  .profile-portrait { width: 76px; height: 76px; border-radius: 25px; }
  .portrait-core { padding: 14px; border-radius: 21px; }
  .profile-copy { margin-top: 13px; }
  .profile-copy h1 { font-size: 27px; }
  .directory-head { align-items: flex-start; }
  .directory-copy { min-width: 0; }
  .directory-index { margin-top: 1px; }
  .link-main { grid-template-columns: 54px minmax(0, 1fr) 28px; gap: 11px; min-height: 76px; }
  .link-media { width: 54px; height: 54px; }
  .site-footer { padding-top: 40px; }
}

@media (max-width: 420px) {
  .page { width: calc(100% - 8px); min-height: calc(100dvh - 8px); margin: 4px auto; padding-inline: 8px; border-radius: 21px; }
  .directory-head { gap: 10px; }
  .directory-head h2 { font-size: 16px; }
  .link-copy h3 { font-size: 13px; }
  .footer-mark p,
  .site-footer > a > span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .masthead,
  .profile-panel,
  .directory,
  .link-card { animation-duration: 1ms; animation-delay: 0ms; }
  .skeleton i::after,
  .skeleton span::after { animation: none; }
  .round-action,
  .brand,
  .link-card,
  .link-share,
  .state button,
  .toast { transition-duration: 1ms; }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes card-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
