/* Neubrutalist link page. Same tokens as Group Checklist / Split Bill / Buzzer:
   warm paper, Archivo, thick ink outlines, hard offset shadows, flat bold colour. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
}

:root {
  --paper: #fbf7ef; --surface: #ffffff; --sunk: #f3eee3;
  --text: #121212; --muted: #5f5b53; --ink: #121212; --shadow: #121212;
  --yellow: #ffcf26; --pink: #ff5a87; --purple: #7b61ff; --green: #3fca45;
  --lime: #b5e93a; --peach: #ffdf96; --on-color: #121212;
  --dots: rgba(18, 18, 18, .09);

  --bw: 2.5px; --r: 14px; --r-btn: 12px;
  --sh-sm: 2px 2px 0 var(--shadow); --sh: 4px 4px 0 var(--shadow); --sh-lg: 6px 6px 0 var(--shadow);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t-press: 90ms; --t-ui: 180ms;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #23212b; --surface: #2f2c39; --sunk: #1b1a21; --text: #f5f0e6; --muted: #b3ada3;
  --ink: #0b0a0e; --shadow: #0b0a0e; --dots: rgba(245, 240, 230, .07);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #23212b; --surface: #2f2c39; --sunk: #1b1a21; --text: #f5f0e6; --muted: #b3ada3;
    --ink: #0b0a0e; --shadow: #0b0a0e; --dots: rgba(245, 240, 230, .07);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dots) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  color: var(--text);
  font: 500 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

/* top bar: theme + share */
.top {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 0;
  max-width: 560px; width: 100%; margin: 0 auto;
}
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r-btn);
  box-shadow: var(--sh-sm); font-size: 20px; font-weight: 800; cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out);
  touch-action: manipulation;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }

.page { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; }
.loading { text-align: center; color: var(--muted); font-weight: 600; padding: 48px 0; }

/* profile */
.profile { text-align: center; padding: 8px 0 26px; }
.avatar {
  width: 104px; height: 104px; margin: 0 auto 16px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: var(--sh-lg); font-size: 54px; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.name {
  margin: 0; font-size: clamp(32px, 9vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
}
.tagline { margin: 8px auto 0; max-width: 34ch; color: var(--muted); font-weight: 600; font-size: 17px; }

/* sections */
.section { margin: 0 0 26px; }
.section-title, .fold > summary {
  display: inline-block; margin: 0 0 12px;
  padding: 4px 10px; background: var(--text); color: var(--paper);
  border-radius: 8px; font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

/* private section: a fold */
.fold > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--text); border: var(--bw) solid var(--ink); box-shadow: var(--sh-sm);
  padding: 7px 12px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .chev { transition: transform var(--t-ui) var(--ease-out); display: inline-block; }
.fold[open] > summary .chev { transform: rotate(90deg); }
.fold > summary small { font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 12px; }

/* the link buttons */
.link {
  --c: var(--surface);
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px 14px;
  background: var(--c); color: var(--on-color); text-decoration: none;
  border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out);
  touch-action: manipulation;
}
.link.c-white { color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .link:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-lg); }
}
.link:active { transform: translate(4px, 4px); box-shadow: none; }

.c-yellow { --c: var(--yellow); } .c-pink { --c: var(--pink); } .c-purple { --c: var(--purple); }
.c-green  { --c: var(--green); }  .c-lime { --c: var(--lime); } .c-peach  { --c: var(--peach); }
.c-white  { --c: var(--surface); }

.link .ico {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--ink); border-radius: 10px; font-size: 22px; line-height: 1;
}
.link .txt { flex: 1; min-width: 0; }
.link .title { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.link .note { display: block; font-size: 14px; font-weight: 600; opacity: .78; margin-top: 2px; }
.link .badge {
  flex: none; padding: 3px 8px; background: #fff; color: #121212;
  border: 2px solid var(--ink); border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.link .arrow { flex: none; font-size: 20px; font-weight: 800; }

/* problems in links.js are shown, not swallowed */
.oops {
  background: #ffe1ea; color: #121212; border: var(--bw) solid var(--ink); border-radius: var(--r);
  box-shadow: var(--sh); padding: 14px 16px; font-weight: 600;
}
.oops code { font-weight: 800; }

.foot { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--paper); padding: 10px 16px; border-radius: 10px;
  font-weight: 700; box-shadow: var(--sh-sm);
  transition: opacity var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* gentle entrance, once */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 320ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
}
