/* ═══════════════════════════════════════════════════════════════════════════
   furrtree.css — /u/NAME
   The look options a user picks at /u/edit arrive as data-attributes on .ft:
     data-button = brand | accent | glass     (how the link buttons are painted)
     data-layout = list | grid | icons        (how they are arranged)
     data-shape  = round | pill | square      (their corners)
   Colours: the site scheme (or the one they picked) + each network's own
   colour (--brand), the same as the organisers' icons on about.html.
   ═══════════════════════════════════════════════════════════════════════════ */

.ft {
    --r: 14px;
    flex: 1;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 2rem) 1rem 3rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);   /* long link texts may not widen the page */
    gap: 1.2rem;
    position: relative;
}
.ft[data-shape="pill"]   { --r: 999px; }
.ft[data-shape="square"] { --r: 4px; }
.ft-page::before {                         /* soft glow in the scheme colour */
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(42rem 26rem at 50% -8%, rgba(var(--accent-rgb), .22), transparent 70%),
        radial-gradient(30rem 20rem at 100% 100%, rgba(var(--accent-rgb), .08), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.ft > * { position: relative; z-index: 1; }

.ft-owner-bar {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
    padding: .6rem .8rem .6rem 1rem; border-radius: 14px;
    border: 1px dashed rgba(var(--accent-rgb), .6); background: rgba(var(--accent-rgb), .08);
    font-size: .8rem;
}
.ft-owner-bar .btn { padding: .45rem 1rem; font-size: .8rem; }

.ft-card {
    text-align: center;
    padding: 2rem clamp(1rem, 4vw, 2rem) 1.6rem;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(26, 23, 20, .82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
    animation: ftRise .5s ease both;
}
@keyframes ftRise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .ft-card { animation: none; } }

.ft-avatar {
    width: 128px; height: 128px; margin: 0 auto 1rem;
    border-radius: 50%; overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .16), 0 10px 30px rgba(0,0,0,.4);
    background: var(--bg);
}
.ft[data-shape="square"] .ft-avatar { border-radius: 18px; }
.ft-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ft-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0;
    overflow-wrap: anywhere;
}
.ft-sub { color: var(--accent-ink); font-size: .82rem; margin-top: .35rem; overflow-wrap: anywhere; }
.ft-bio { color: var(--muted); font-size: .9rem; line-height: 1.65; margin: .9rem auto 0; max-width: 46ch; overflow-wrap: anywhere; }
.ft-emoji { font-size: 3rem; margin-bottom: .6rem; }
.ft-404 .btn { margin-top: 1.2rem; display: inline-block; }

/* ── link buttons ── */
.ft-links { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem; margin-top: 1.5rem; }
.ft-link {
    position: relative;
    display: flex; align-items: center; gap: .8rem;
    width: 100%;
    padding: .55rem .9rem .55rem .55rem;
    border-radius: var(--r);
    font: inherit; font-size: .92rem; font-weight: 600;
    text-decoration: none; text-align: left;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.ft-link:hover { transform: translateY(-2px); }
.ft-link:active { transform: translateY(0); }
.ft-ico {
    flex: none; width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: calc(var(--r) * .75);
    color: #fff;
}
.ft[data-shape="pill"] .ft-ico { border-radius: 50%; }
.ft-ico svg { width: 22px; height: 22px; }
.ft-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; padding-right: 40px; }
.ft-go { position: absolute; right: 1rem; opacity: .55; font-size: .9rem; }
.ft-link.copied::after {
    content: "✓"; position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
    background: #4ade80; color: #0e0c0a; width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center; font-size: .75rem;
}

/* brand: the whole button in the network's colour */
.ft[data-button="brand"] .ft-link { background: var(--brand); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.ft[data-button="brand"] .ft-ico  { background: rgba(255,255,255,.12); }
.ft[data-button="brand"] .ft-link:hover { box-shadow: 0 10px 26px rgba(0,0,0,.45); }

/* accent: outlined in the site colour, network colour only in the icon */
.ft[data-button="accent"] .ft-link { background: transparent; color: var(--text); border: 2px solid var(--accent); }
.ft[data-button="accent"] .ft-ico  { background: var(--brand); }
.ft[data-button="accent"] .ft-link:hover { background: rgba(var(--accent-rgb), .12); }

/* glass: quiet see-through cards */
.ft[data-button="glass"] .ft-link { background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--border); }
.ft[data-button="glass"] .ft-ico  { background: var(--brand); }
.ft[data-button="glass"] .ft-link:hover { border-color: var(--accent); background: rgba(255,255,255,.08); }

/* layouts */
.ft[data-layout="grid"] .ft-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ft[data-layout="grid"] .ft-link  { flex-direction: column; padding: .9rem .6rem; gap: .5rem; }
.ft[data-layout="grid"] .ft-label { padding: 0; width: 100%; font-size: .8rem; }
.ft[data-layout="grid"] .ft-go    { top: .6rem; right: .7rem; }

.ft[data-layout="icons"] .ft-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
.ft[data-layout="icons"] .ft-link  { width: auto; padding: 0; background: none !important; border: 0 !important; box-shadow: none !important; }
.ft[data-layout="icons"] .ft-ico   { width: 54px; height: 54px; background: var(--brand) !important; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.ft[data-layout="icons"] .ft-ico svg { width: 28px; height: 28px; }
.ft[data-layout="icons"] .ft-label,
.ft[data-layout="icons"] .ft-go    { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; }

/* ── sections under the card ── */
.ft-sec {
    padding: 1.2rem 1.2rem 1.3rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(26, 23, 20, .7);
}
.ft-sec h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: .8rem;
}
.ft-sec h2 small { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: var(--muted); font-weight: 400; }
.ft-sonas { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .7rem; }
.ft-sona { display: grid; gap: .4rem; justify-items: center; text-decoration: none; color: var(--accent-ink); font-size: .8rem; font-weight: 700; }
.ft-sona-pic {
    width: 100%; aspect-ratio: 1; display: grid; place-items: center; font-size: 2rem;
    border-radius: 18px; overflow: hidden; background: var(--bg); border: 2px solid rgba(var(--accent-rgb), .45);
    transition: border-color .15s, transform .15s;
}
.ft-sona-pic img { width: 100%; height: 100%; object-fit: cover; }
.ft-sona:hover .ft-sona-pic { border-color: var(--accent); transform: translateY(-2px); }
.ft-more { display: inline-block; margin-top: .8rem; color: var(--accent-ink); font-size: .82rem; text-decoration: none; }
.ft-more:hover { text-decoration: underline; }

.ft-foot { display: flex; justify-content: center; align-items: center; gap: 1.2rem; flex-wrap: wrap; font-size: .78rem; }
.ft-foot a { color: var(--muted); text-decoration: none; }
.ft-share {
    font: inherit; font-size: .78rem; color: var(--text); cursor: pointer;
    background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 999px; padding: .45rem .9rem;
}
.ft-share.copied { border-color: #4ade80; color: #4ade80; }

@media (max-width: 420px) {
    .ft[data-layout="grid"] .ft-links { gap: .5rem; }
    .ft-avatar { width: 108px; height: 108px; }
}

/* the phone preview inside /u/edit */
.ft-embed .site-nav, .ft-embed .site-footer, .ft-embed .ft-owner-bar, .ft-embed .ft-foot { display: none; }
.ft-embed .ft { padding-top: 1.2rem; }

/* ═══ EDITOR (/u/edit) ═══ */
.fte { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: calc(var(--nav-h) + 2rem) clamp(1rem, 3vw, 2rem) 3rem; }
.fte-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1.4rem; align-items: start; }
.fte-preview { position: sticky; top: calc(var(--nav-h) + 1rem); }
.fte-phone {
    border: 10px solid #1d1a17; border-radius: 38px; overflow: hidden; height: min(78vh, 760px);
    box-shadow: 0 0 0 1px var(--border), 0 24px 60px rgba(0,0,0,.5); background: var(--bg);
}
.fte-phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.fte-preview p { text-align: center; font-size: .75rem; color: var(--muted); margin-top: .6rem; }
.fte-url { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .82rem; }
.fte-url code { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .6rem; overflow-wrap: anywhere; }
.fte-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.fte-opt {
    display: grid; gap: .45rem; padding: .7rem; border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg); cursor: pointer; font-size: .78rem; text-align: center;
}
.fte-opt input { position: absolute; opacity: 0; pointer-events: none; }
.fte-opt:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.fte-opt:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.fte-mini { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 8px; font-size: .62rem; }
.fte-mini i { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.fte-mini.brand  { background: #1a5c96; color: #fff; }
.fte-mini.brand i { background: rgba(255,255,255,.2); }
.fte-mini.accent { border: 2px solid var(--accent); }
.fte-mini.accent i, .fte-mini.glass i { background: #1a5c96; }
.fte-mini.glass  { background: rgba(255,255,255,.06); border: 1px solid var(--border); }
.fte-lay { height: 34px; display: grid; gap: 3px; }
.fte-lay i { display: block; background: rgba(var(--accent-rgb), .55); border-radius: 3px; }
.fte-lay.list { grid-template-rows: repeat(3, 1fr); }
.fte-lay.grid { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.fte-lay.icons { display: flex; justify-content: center; align-items: center; gap: 4px; }
.fte-lay.icons i { width: 14px; height: 14px; border-radius: 50%; }
.fte-shape { height: 30px; border: 2px solid var(--accent); margin: 0 10%; }
.fte-shape.round { border-radius: 9px; } .fte-shape.pill { border-radius: 999px; } .fte-shape.square { border-radius: 2px; }

.fte-links { list-style: none; display: grid; gap: .45rem; margin: 0 0 1rem; padding: 0; }
.fte-link { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: .6rem; align-items: center;
    padding: .5rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.fte-link .ft-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); }
.fte-link .ft-ico svg { width: 20px; height: 20px; }
.fte-link-main { display: grid; gap: .25rem; min-width: 0; }
.fte-link-main input[type=text] { padding: .45rem .6rem !important; font-size: .82rem !important; }
.fte-link-main small { color: var(--muted); font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fte-link-acts { display: flex; gap: .25rem; align-items: center; }
.fte-link-acts .u-check { font-size: .72rem; margin-right: .3rem; }
.fte-link.off { opacity: .55; }
.fte-save { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: flex-end; gap: .6rem;
    padding: .8rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
.fte-save .btn { padding: .75rem 1.8rem; font-weight: 700; }

@media (max-width: 960px) {
    .fte-grid { grid-template-columns: 1fr; }
    .fte-preview { position: static; order: -1; }
    .fte-phone { height: 520px; max-width: 380px; margin: 0 auto; }
}
