/* Takuto+ — personalized Featured work. Rules: .cursor/rules/takuto-plus-design.mdc */

.tp-app,
.project-overlay-card {
    --tp-r: 12px;
    --tp-surface: #0b0f16;
    --tp-surface-2: #10151e;
}

/* ---------- shared pieces ---------- */
.tp-kicker {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-40);
}
.tp-num { font-family: var(--font-serif); font-weight: 400; font-variant-numeric: tabular-nums; }
.tp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border: 0;
    background: none;
    color: var(--ink-60);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}
.tp-link svg { width: 13px; height: 13px; }
.tp-link:hover,
.tp-link:focus-visible { color: var(--ink); }
.tp-link:focus-visible { outline: 2px solid var(--pc, var(--ink)); outline-offset: 4px; border-radius: 4px; }
.tp-app .btn svg { width: 13px; height: 13px; }
.tp-live-dot {
    display: inline-block;
    flex: none;
    width: 7px;
    height: 7px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--pc, #67d8f0);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc, #67d8f0) 22%, transparent);
    animation: tp-pulse 2.4s ease-in-out infinite;
}
@keyframes tp-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--pc, #67d8f0) 6%, transparent); } }

/* ---------- detail view (overlay) ---------- */
.overlay-banner {
    display: inline-flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 6px 12px;
    border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent);
    border-radius: 999px;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 600;
}
.overlay-banner[hidden] { display: none; }
.overlay-episodes { margin: 0; padding: 0; list-style: none; }
.overlay-episodes li {
    display: grid;
    grid-template-columns: 44px 1fr minmax(0, 0.9fr);
    gap: 16px;
    align-items: baseline;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
.ep-num { font-family: var(--font-serif); font-size: 1.15rem; color: var(--ink-40); font-variant-numeric: tabular-nums; }
.ep-title { font-weight: 500; }
.ep-metric { color: var(--ink-60); font-size: 0.85rem; text-align: right; }
@media (max-width: 560px) {
    .overlay-episodes li { grid-template-columns: 36px 1fr; row-gap: 4px; }
    .ep-metric { grid-column: 2; text-align: left; }
}

/* ---------- app shell ---------- */
.tp-app { min-height: 420px; scroll-margin-top: calc(var(--nav-h) + 32px); }

/* no-JS fallback */
.tp-fallback { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tp-fallback-card { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.tp-fallback-card h3 { font-size: 1.15rem; font-weight: 600; }
.tp-fallback-card p { margin-top: 6px; color: var(--ink-60); }

/* ---------- who's watching: polaroids on a desk ---------- */
.tp-stage {
    --paper: #f6f1e7;
    --ink-dark: #1f2030;
    position: relative;
    isolation: isolate;
    width: 100vw;
    min-height: max(100svh, 820px);
    margin: calc(-1 * (var(--nav-h) + 56px)) 0 0 calc(50% - 50vw);
    padding: calc(var(--nav-h) + 40px) 24px clamp(120px, 12vw, 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0c0d1a;
}
.tp-scene { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.tp-spines text { font: 600 25px var(--font-ui); letter-spacing: 4px; fill: rgba(206, 210, 232, 0.78); }
.tp-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(60% 55% at 50% 42%, rgba(12, 13, 26, 0.55), transparent 70%);
    pointer-events: none;
}
.tp-stage-inner { width: min(1060px, 100%); text-align: center; }
.tp-stage-kicker { color: rgba(214, 218, 238, 0.7); }

.tp-picker-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.22em;
    margin-top: 18px;
    font-size: clamp(2.6rem, 6.4vw, 4.6rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.035em;
}
.tp-script {
    position: relative;
    isolation: isolate;
    font-family: var(--font-hand);
    font-size: 1.28em;
    font-weight: 700;
    letter-spacing: 0;
}
.tp-swoosh { position: absolute; left: -2%; right: -4%; bottom: -0.08em; width: 106%; height: 0.24em; color: #b7a6f5; z-index: -1; }
.tp-doodle-tv { width: 1.05em; height: 0.95em; margin-right: 0.15em; color: #c9bcff; transform: rotate(-8deg); }
.tp-doodle-spark { align-self: flex-start; width: 0.55em; height: 0.55em; color: #c9bcff; }

.tp-profiles {
    margin-top: 48px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 220px));
    justify-content: center;
    gap: clamp(16px, 2.6vw, 34px);
}
.tp-polaroid {
    --tilt: 0deg;
    --lift: 0px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 11px 11px 18px;
    border: 0;
    border-radius: 3px;
    background: var(--paper);
    color: var(--ink-dark);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.5) inset, 0 22px 40px -18px rgba(0, 0, 0, 0.75), 0 4px 10px rgba(0, 0, 0, 0.25);
    transform: translateY(var(--lift)) rotate(var(--tilt));
    transition: transform 0.45s var(--ease-spring), box-shadow 0.3s;
}
.tp-polaroid:nth-child(1) { --tilt: -4deg; --lift: 6px; }
.tp-polaroid:nth-child(2) { --tilt: 2.5deg; --lift: -4px; }
.tp-polaroid:nth-child(3) { --tilt: -1.5deg; --lift: 4px; }
.tp-polaroid:nth-child(4) { --tilt: 3deg; --lift: -2px; }
.tp-polaroid::before {
    content: "";
    position: absolute;
    top: -13px;
    left: 50%;
    width: 78px;
    height: 24px;
    transform: translateX(-50%) rotate(-3deg);
    background: rgba(214, 214, 204, 0.62);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    clip-path: polygon(3% 0, 97% 4%, 100% 100%, 0 94%);
}
.tp-polaroid:hover,
.tp-polaroid:focus-visible {
    transform: translateY(-10px) rotate(0deg) scale(1.03);
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.5) inset, 0 34px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px color-mix(in srgb, var(--pc) 55%, transparent);
    z-index: 1;
}
.tp-polaroid:focus-visible { outline: 3px solid var(--pc); outline-offset: 6px; }
.tp-photo { position: relative; display: block; width: 100%; aspect-ratio: 1; background: var(--tint); border-radius: 2px; }
.tp-photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.tp-sticker {
    position: absolute;
    right: -12px;
    bottom: -24px;
    width: 50px;
    height: 50px;
    transform: rotate(8deg);
    filter: drop-shadow(1.6px 0 0 #fff) drop-shadow(-1.6px 0 0 #fff) drop-shadow(0 1.6px 0 #fff) drop-shadow(0 -1.6px 0 #fff) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.3));
    transition: transform 0.45s var(--ease-spring);
}
.tp-polaroid:hover .tp-sticker,
.tp-polaroid:focus-visible .tp-sticker { transform: rotate(-6deg) scale(1.1); }
.tp-polaroid-label {
    margin-top: 12px;
    padding: 0 6px;
    font-family: var(--font-hand);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(transparent 52%, color-mix(in srgb, var(--pc) 70%, transparent) 52% 88%, transparent 88%);
}
.tp-polaroid-blurb { margin-top: 6px; padding-right: 8px; font-size: 0.8rem; line-height: 1.45; color: #4a4b5e; }

.tp-picker-hint {
    position: relative;
    display: inline-block;
    margin-top: 52px;
    color: rgba(232, 235, 248, 0.86);
    font-size: 1rem;
}
.tp-doodle-arrow { position: absolute; left: -84px; top: -38px; width: 70px; height: 50px; color: rgba(232, 235, 248, 0.75); }
.tp-you { text-decoration: underline; text-decoration-color: #b7a6f5; text-decoration-thickness: 2px; text-underline-offset: 5px; }

.tp-avatar-sm { display: inline-block; width: 28px; height: 28px; overflow: hidden; border-radius: 999px; }
.tp-avatar-sm img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 960px) {
    .tp-profiles { grid-template-columns: repeat(2, minmax(0, 220px)); row-gap: 44px; }
    .tp-doodle-arrow { display: none; }
}
@media (max-width: 560px) {
    .tp-stage { min-height: 100svh; padding-inline: 16px; }
    .tp-picker-title { font-size: clamp(2.3rem, 11vw, 3rem); }
    .tp-doodle-tv,
    .tp-doodle-spark { display: none; }
    .tp-profiles { gap: 28px 14px; }
    .tp-polaroid { padding: 8px 8px 14px; }
    .tp-polaroid:nth-child(n) { --tilt: calc(var(--t, 0) * 1deg); }
    .tp-polaroid:nth-child(1) { --t: -2.5; }
    .tp-polaroid:nth-child(2) { --t: 2; }
    .tp-polaroid:nth-child(3) { --t: -1.5; }
    .tp-polaroid:nth-child(4) { --t: 2.5; }
    .tp-polaroid-label { font-size: 1.5rem; }
    .tp-polaroid-blurb { font-size: 0.74rem; }
    .tp-sticker { width: 40px; height: 40px; right: -8px; bottom: -18px; }
    .tp-picker-hint { margin-top: 36px; font-size: 0.9rem; }
}

.tp-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 420px; color: var(--ink-60); }
.tp-loader-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--pc);
    border-radius: 999px;
    animation: tp-spin 0.8s linear infinite;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* ---------- home ---------- */
.tp-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.tp-bar-who { display: flex; align-items: center; gap: 10px; color: var(--ink-60); font-size: 0.9rem; }

.tp-art {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 80% 0%, color-mix(in srgb, var(--pc) 30%, transparent), transparent 62%),
        var(--tp-surface);
}
.tp-art-feature { aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--tp-r); }
.tp-art-logo { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.tp-art-logo img {
    display: block;
    width: var(--logo-w);
    height: auto;
    max-height: 58%;
    object-fit: contain;
    opacity: 0.94;
    transition: transform 0.6s var(--ease-out), opacity 0.3s;
}
.tp-card:hover .tp-art-logo img,
.tp-card:focus-visible .tp-art-logo img { transform: scale(1.05); opacity: 1; }
.overlay-logo .tp-art { aspect-ratio: 16 / 6; }
.overlay-logo[hidden] { display: none; }
.tp-art-corner {
    position: absolute;
    left: 16px;
    bottom: 12px;
    display: flex;
    align-items: center;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-60);
}
.tp-silks { display: flex; gap: 10px; }
.tp-silks i { width: 16px; height: 16px; border-radius: 999px; box-shadow: 0 0 0 3px var(--tp-surface), 0 0 0 4px var(--line-strong); }
.tp-art-feature .tp-silks i { width: 22px; height: 22px; }

.tp-feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.tp-feature-meta { display: flex; align-items: baseline; gap: 14px; }
.tp-feature-meta .tp-num { font-size: 1.4rem; color: var(--pc); }
.tp-feature-title { margin-top: 8px; font-size: clamp(2.4rem, 5vw, 3.5rem); line-height: 1; font-weight: 600; letter-spacing: -0.035em; }
.tp-feature-pitch { margin-top: 14px; max-width: 460px; color: var(--ink-60); }
.tp-stats {
    margin: 24px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, max-content));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.tp-stats div { padding: 14px 24px 14px 0; margin-right: 24px; border-right: 1px solid var(--line); }
.tp-stats div:last-child { margin-right: 0; border-right: 0; }
.tp-stats dt { font-size: 1.9rem; line-height: 1.1; color: var(--ink); }
.tp-stats dd { margin: 2px 0 0; color: var(--ink-60); font-size: 0.78rem; }
.tp-feature-actions { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.tp-feature-note { color: var(--ink-40); font-size: 0.85rem; }

.tp-picks { margin-top: 56px; }
.tp-grid-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.tp-grid-title { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.tp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.tp-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--tp-r);
    background: var(--tp-surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.3s var(--ease-out), border-color 0.2s;
}
.tp-card .tp-art { border-bottom: 1px solid var(--line); }
.tp-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tp-card:focus-visible { outline: 2px solid var(--pc); outline-offset: 3px; }
.tp-card-body {
    flex: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto 1fr;
    column-gap: 14px;
    padding: 16px 18px 18px;
}
.tp-card-num { grid-row: 1 / -1; font-size: 1.4rem; line-height: 1; color: var(--ink-40); padding-top: 1px; transition: color 0.2s; }
.tp-card:hover .tp-card-num,
.tp-card:focus-visible .tp-card-num { color: var(--pc); }
.tp-card-name { font-weight: 600; }
.tp-card-role { color: var(--ink-60); font-size: 0.82rem; }
.tp-card-metric { align-self: end; margin-top: 12px; font-size: 0.85rem; color: var(--ink-60); }
.tp-card-metric b { color: var(--ink); font-weight: 600; }

@media (max-width: 900px) {
    .tp-feature { grid-template-columns: 1fr; gap: 24px; }
    .tp-art-feature { order: -1; }
    .tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .tp-bar-who { font-size: 0.85rem; }
    .tp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tp-stats div { padding-right: 10px; margin-right: 10px; }
    .tp-stats dt { font-size: 1.4rem; }
    .tp-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .tp-loader-ring,
    .tp-live-dot { animation: none; }
    .tp-card,
    .tp-polaroid,
    .tp-sticker { transition: none; }
}

/* ---------- race day ---------- */
.race-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.race-live { display: flex; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-60); }
.race-title { margin-top: 28px; font-size: clamp(2.2rem, 4.5vw, 3rem); line-height: 1; font-weight: 600; letter-spacing: -0.03em; }
.race-intro { margin-top: 12px; max-width: 620px; color: var(--ink-60); }
.race-prompt { margin-top: 24px; font-weight: 600; }
.race-track { margin-top: 12px; border-top: 2px solid var(--ink); }
.race-cols {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-strong);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-40);
}
.race-lane {
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.race-pick {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    column-gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--tp-r);
    background: none;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.race-pick:hover:not(:disabled) { background: rgba(255, 255, 255, 0.04); }
.race-pick:focus-visible { outline: 2px solid var(--pc); outline-offset: 2px; }
.race-pick:disabled { cursor: default; }
.race-gate {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--pc);
    color: #05060a;
    font-family: var(--font-serif);
    font-size: 1.05rem;
}
.race-horse-name { font-size: 0.95rem; font-weight: 600; }
.race-place { grid-row: span 2; font-family: var(--font-serif); font-size: 1.2rem; color: var(--ink-40); }
.race-form { color: var(--ink-60); font-size: 0.75rem; }
.race-run { position: relative; height: 30px; }
.race-run::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line-strong); }
.race-run::after { content: ""; position: absolute; top: -10px; bottom: -10px; right: 0; border-right: 1px solid var(--ink-60); }
.race-horse {
    position: absolute;
    top: 3px;
    left: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 24px;
    border-radius: 6px;
    background: var(--pc);
    color: #05060a;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--pc) 80%, transparent);
}
.race-lane.is-pick .race-pick { border-color: color-mix(in srgb, var(--pc) 50%, transparent); background: color-mix(in srgb, var(--pc) 10%, transparent); }
.race-lane.is-winner .race-place { color: var(--pc); }
.race-status { margin-top: 16px; min-height: 1.5em; font-weight: 600; }
.race-again { margin-top: 4px; }
.race-again[hidden] { display: none; }

@media (max-width: 720px) {
    .race-lane { grid-template-columns: 1fr; gap: 4px; }
    .race-run { margin: 0 10px 6px; }
}

/* ---------- guestbook ---------- */
.tp-guestbook { margin-top: 80px; padding-top: 32px; border-top: 1px solid var(--line); }
.tp-guestbook[hidden] { display: none; }
.tp-guestbook-head h3 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.tp-guestbook-head p { margin-top: 6px; color: var(--ink-60); }

.tp-ticker {
    margin-top: 24px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.tp-ticker:focus-visible { outline: 2px solid var(--pc, #7aa7ff); outline-offset: 4px; }
.tp-ticker-track { display: flex; width: max-content; margin: 0; padding: 0; list-style: none; animation: tp-ticker var(--tp-ticker-duration, 60s) linear infinite; }
.tp-ticker:hover .tp-ticker-track,
.tp-ticker:focus-within .tp-ticker-track { animation-play-state: paused; }
@keyframes tp-ticker { to { transform: translateX(-50%); } }
.tp-review {
    flex: 0 0 300px;
    margin-right: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-soft);
}
.tp-review p { font-size: 0.95rem; }
.tp-review span { display: block; margin-top: 8px; color: var(--ink-40); font-size: 0.8rem; }

.tp-review-form { position: relative; margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px; border-radius: 12px; }
.tp-field { display: grid; gap: 6px; color: var(--ink-60); font-size: 0.85rem; }
.tp-field-wide { grid-column: 1 / -1; }
.tp-field input,
.tp-field textarea {
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
}
.tp-field textarea { min-height: 90px; resize: vertical; }
.tp-field input:focus-visible,
.tp-field textarea:focus-visible { outline: 2px solid var(--pc, #7aa7ff); outline-offset: 1px; }
.tp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tp-review-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.tp-review-status { color: #4fd1c5; font-size: 0.9rem; }
.tp-review-status.is-error { color: #f58ea8; }

@media (max-width: 720px) {
    .tp-review-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .tp-ticker { overflow-x: auto; }
    .tp-ticker-track { animation: none; }
    .tp-review[aria-hidden="true"] { display: none; }
}
