/* lunch.quest — palette */
/*
   #f3ead3  parchment cream
   #e9dcb4  parchment shadow
   #1a1a1a  ink black
   #c84630  tomato red
   #d99a2b  mustard yellow
   #2f6b3a  leaf green
   #4d3b2a  oak brown
*/

:root {
    --cream: #f3ead3;
    --cream-2: #e9dcb4;
    --ink: #1a1a1a;
    --tomato: #c84630;
    --mustard: #d99a2b;
    --leaf: #2f6b3a;
    --oak: #4d3b2a;
    --paper: #f7f0db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--cream);
    color: var(--ink);
    line-height: 1.55;
    overflow-x: hidden;
    font-weight: 400;
}

/* paper grain */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 25% 30%, rgba(77,59,42,0.045) 1px, transparent 2px),
        radial-gradient(circle at 75% 70%, rgba(77,59,42,0.04) 1px, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(77,59,42,0.03) 1px, transparent 2px);
    background-size: 13px 13px, 19px 19px, 23px 23px;
    z-index: 1;
    mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ───────── topbar ───────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 40px;
    background: var(--cream);
    border-bottom: 1.5px solid var(--ink);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    font-family: 'VT323', monospace;
    font-size: 22px;
    color: var(--tomato);
    letter-spacing: 1px;
}
.brand-name {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.topnav { display: flex; gap: 28px; }
.topnav a {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    position: relative;
    transition: color .25s ease;
}
.topnav a:hover { color: var(--tomato); }
.topnav a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 1.5px;
    background: var(--tomato);
    transition: width .3s ease;
}
.topnav a:hover::after { width: 100%; }

.time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}
.time #clock {
    font-family: 'VT323', monospace;
    font-size: 26px;
    color: var(--ink);
}
.time-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--oak);
    margin-top: 4px;
}

/* ───────── hero ───────── */
.hero {
    padding: 80px 40px 100px;
    position: relative;
    z-index: 2;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
}

.kicker {
    font-family: 'VT323', monospace;
    font-size: 18px;
    letter-spacing: 0.06em;
    color: var(--tomato);
    margin-bottom: 24px;
    text-transform: lowercase;
}

.hero-title {
    font-size: clamp(56px, 9vw, 132px);
    font-weight: 900;
    line-height: 0.92;
    letter-spacing: -0.045em;
    margin-bottom: 32px;
}
.hero-title .line { display: block; }
.hero-title .outline {
    -webkit-text-stroke: 2px var(--ink);
    color: transparent;
}
.hero-title .tiny {
    font-size: 0.32em;
    font-weight: 500;
    letter-spacing: 0;
    margin-top: 18px;
    color: var(--oak);
    text-transform: lowercase;
    font-style: italic;
}

.hero-lede {
    font-size: 18px;
    line-height: 1.6;
    max-width: 480px;
    color: var(--oak);
    margin-bottom: 36px;
}

.hero-cta { display: flex; gap: 16px; align-items: center; margin-bottom: 36px; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    background: var(--ink);
    color: var(--cream);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    border-radius: 0;
    transition: transform .2s ease, background .2s ease;
}
.btn-primary:hover { transform: translate(-2px, -2px); background: var(--tomato); }
.btn-primary.big {
    padding: 22px 36px;
    font-size: 18px;
    width: 100%;
    justify-content: center;
}
.btn-die {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: var(--mustard);
    color: var(--ink);
    font-family: 'VT323', monospace;
    font-size: 14px;
    transform: rotate(-8deg);
    transition: transform .3s ease;
}
.btn-primary:hover .btn-die { transform: rotate(360deg); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 14px 22px;
    border: 1.5px solid var(--ink);
    font-size: 14px;
    font-weight: 500;
    transition: background .2s ease, color .2s ease;
}
.btn-ghost:hover { background: var(--ink); color: var(--cream); }

.hero-meta {
    display: flex;
    gap: 28px;
    font-size: 13px;
    color: var(--oak);
    border-top: 1px solid var(--ink);
    padding-top: 16px;
    max-width: 480px;
}
.hero-meta b { color: var(--ink); font-weight: 700; font-size: 16px; }

/* ───── hero right ───── */
.hero-right {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 32px;
}

.quest-card {
    width: 100%;
    max-width: 420px;
    background: var(--paper);
    border: 1.5px solid var(--ink);
    box-shadow: 8px 8px 0 var(--ink);
    padding: 28px 28px 24px;
    transform: rotate(-1.5deg);
    transition: transform .35s ease;
}
.quest-card:hover { transform: rotate(0deg); }

.qc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--ink);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.qc-stamp {
    font-family: 'VT323', monospace;
    font-size: 18px;
    background: var(--tomato);
    color: var(--cream);
    padding: 2px 10px;
    letter-spacing: 0.1em;
    transform: rotate(-2deg);
}
.qc-id {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--oak);
}
.qc-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 18px;
    min-height: 60px;
}
.qc-stats {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 18px;
    margin-bottom: 18px;
    font-size: 13px;
}
.qc-stats li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dotted var(--oak);
}
.qc-stats span { color: var(--oak); }
.qc-stats b { font-weight: 600; }

.qc-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--ink);
}
.qc-die {
    font-family: 'VT323', monospace;
    font-size: 32px;
    width: 56px; height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mustard);
    border: 1.5px solid var(--ink);
    color: var(--ink);
    transform: rotate(-6deg);
    flex-shrink: 0;
}
.qc-result {
    font-size: 13px;
    color: var(--oak);
    line-height: 1.4;
}

/* dial / compass */
.dial {
    position: relative;
    width: 120px;
    height: 120px;
}
.dial-ring {
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 60%, var(--cream-2) 60%, var(--cream-2) 62%, transparent 62%),
        repeating-conic-gradient(var(--ink) 0deg 1deg, transparent 1deg 30deg);
    background-blend-mode: multiply;
    transition: transform .8s cubic-bezier(.2,.7,.1,1);
}
.dial-needle {
    position: absolute;
    left: 50%; top: 50%;
    width: 4px; height: 50px;
    margin-left: -2px;
    margin-top: -50px;
    background: linear-gradient(to bottom, var(--tomato) 0%, var(--tomato) 60%, var(--ink) 60%, var(--ink) 100%);
    transform-origin: bottom center;
    transition: transform 1s cubic-bezier(.2,.7,.1,1);
}
.dial-center {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: var(--ink);
    background: var(--cream);
    padding: 0 6px;
}

/* ───────── section title ───────── */
.section-title {
    font-size: clamp(40px, 5vw, 72px);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin-bottom: 16px;
}
.section-title.light { color: var(--cream); }
.section-sub {
    font-size: 16px;
    color: var(--oak);
    margin-bottom: 48px;
}
.section-sub.centered { text-align: center; }

/* ───────── scroll section ───────── */
.scroll-section {
    padding: 80px 40px;
    position: relative;
    z-index: 2;
}
.scroll-paper {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--paper);
    border-left: 1.5px solid var(--ink);
    border-right: 1.5px solid var(--ink);
    position: relative;
}
.scroll-edge {
    height: 18px;
    background:
        radial-gradient(circle at 10px 18px, var(--paper) 9px, transparent 10px) 0 0/20px 18px repeat-x,
        var(--cream);
    border-bottom: 1.5px solid var(--ink);
}
.scroll-edge.bottom {
    background:
        radial-gradient(circle at 10px 0, var(--paper) 9px, transparent 10px) 0 0/20px 18px repeat-x,
        var(--cream);
    border-bottom: none;
    border-top: 1.5px solid var(--ink);
}
.scroll-body {
    padding: 60px 60px;
}
.scroll-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 24px;
}
.scroll-grid article {
    border-top: 1.5px solid var(--ink);
    padding-top: 18px;
}
.rune {
    font-family: 'VT323', monospace;
    font-size: 28px;
    color: var(--tomato);
    display: block;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}
.scroll-grid h3 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.2;
}
.scroll-grid p {
    font-size: 15px;
    color: var(--oak);
    line-height: 1.6;
}

/* ───────── quest section ───────── */
.quest-section {
    background: var(--ink);
    color: var(--cream);
    padding: 100px 40px;
    position: relative;
    z-index: 2;
}
.qs-head {
    max-width: 1100px;
    margin: 0 auto 56px;
    text-align: center;
}
.qs-head .section-sub { color: var(--cream-2); }
.qs-body {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.qs-controls .control { margin-bottom: 28px; }
.qs-controls label {
    display: block;
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 0.1em;
    color: var(--mustard);
    margin-bottom: 10px;
    text-transform: uppercase;
}
.seg {
    display: flex;
    border: 1.5px solid var(--cream);
}
.seg button {
    flex: 1;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cream);
    background: transparent;
    transition: background .2s ease, color .2s ease;
    border-right: 1.5px solid var(--cream);
}
.seg button:last-child { border-right: none; }
.seg button:hover { background: rgba(243,234,211,0.08); }
.seg button.active {
    background: var(--cream);
    color: var(--ink);
    font-weight: 700;
}

.qs-readout {
    background: rgba(243,234,211,0.04);
    border: 1.5px solid var(--cream-2);
    padding: 28px;
}
.readout-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px dotted rgba(243,234,211,0.3);
    gap: 16px;
}
.readout-line:last-of-type { border-bottom: none; }
.rl-label {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--mustard);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.rl-val {
    font-size: 14px;
    text-align: right;
    color: var(--cream);
    font-weight: 500;
}
.readout-map {
    margin-top: 20px;
    border: 1.5px solid var(--cream-2);
    background: var(--cream);
    aspect-ratio: 5/3;
    overflow: hidden;
}
#mapSvg { width: 100%; height: 100%; display: block; }

/* ───────── guild section ───────── */
.guild-section {
    padding: 100px 40px;
    text-align: center;
    position: relative;
    z-index: 2;
}
.guild-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}
.guild-card {
    background: var(--paper);
    border: 1.5px solid var(--ink);
    padding: 28px 22px;
    text-align: left;
    transition: transform .35s cubic-bezier(.2,.7,.1,1), box-shadow .35s ease;
    transform: rotate(0deg);
}
.guild-card:nth-child(2) { transform: rotate(0.6deg); }
.guild-card:nth-child(3) { transform: rotate(-0.4deg); }
.guild-card:nth-child(4) { transform: rotate(0.3deg); }
.guild-card:hover {
    transform: rotate(0deg) translate(-4px, -4px);
    box-shadow: 8px 8px 0 var(--ink);
}
.patch {
    width: 80px;
    height: 80px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    background: var(--cream);
}
.patch svg { width: 60px; height: 60px; display: block; }
.p-forager { color: var(--leaf); }
.p-merchant { color: var(--mustard); }
.p-scholar { color: var(--oak); }
.p-bard { color: var(--tomato); }

.guild-card h3 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}
.guild-card p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--oak);
    margin-bottom: 18px;
    min-height: 80px;
}
.guild-stat {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--ink);
    background: var(--mustard);
    padding: 3px 10px;
    display: inline-block;
    letter-spacing: 0.06em;
}

/* ───────── codex ───────── */
.codex-section {
    padding: 100px 40px;
    background: var(--paper);
    position: relative;
    z-index: 2;
    border-top: 1.5px solid var(--ink);
    border-bottom: 1.5px solid var(--ink);
}
.codex-head { max-width: 1100px; margin: 0 auto 40px; }
.codex-table {
    max-width: 1100px;
    margin: 0 auto 24px;
    border: 1.5px solid var(--ink);
}
.codex-row {
    display: grid;
    grid-template-columns: 80px 2fr 1.4fr 80px 120px;
    gap: 18px;
    padding: 14px 22px;
    font-size: 14px;
    border-bottom: 1px dotted var(--oak);
    align-items: baseline;
    transition: background .2s ease;
}
.codex-row:last-child { border-bottom: none; }
.codex-row:hover:not(.codex-head-row) { background: var(--cream-2); }
.codex-head-row {
    background: var(--ink);
    color: var(--cream);
    font-family: 'VT323', monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 14px;
    padding: 12px 22px;
}
.v-good { color: var(--leaf); font-weight: 600; }
.v-mid { color: var(--mustard); font-weight: 600; }
.v-bad { color: var(--tomato); font-weight: 600; }

.codex-foot {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--oak);
    letter-spacing: 0.05em;
    border-top: 1.5px solid var(--ink);
    padding-top: 16px;
}
.codex-foot b { color: var(--ink); font-weight: 400; }

/* ───────── cta ───────── */
.cta-section {
    padding: 120px 40px;
    background: var(--tomato);
    color: var(--cream);
    position: relative;
    z-index: 2;
    text-align: center;
}
.cta-inner {
    max-width: 720px;
    margin: 0 auto;
}
.cta-section h2 {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 18px;
}
.cta-section p {
    font-size: 17px;
    margin-bottom: 32px;
    opacity: 0.9;
}
.cta-form {
    display: flex;
    gap: 0;
    max-width: 460px;
    margin: 0 auto 18px;
    border: 1.5px solid var(--cream);
}
.cta-form input {
    flex: 1;
    padding: 16px 18px;
    background: transparent;
    border: none;
    color: var(--cream);
    font-family: inherit;
    font-size: 15px;
    outline: none;
}
.cta-form input::placeholder { color: rgba(243,234,211,0.7); }
.cta-form button {
    padding: 16px 28px;
    background: var(--cream);
    color: var(--ink);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
    transition: background .2s ease;
}
.cta-form button:hover { background: var(--mustard); }
.cta-fine {
    font-size: 12px;
    opacity: 0.75;
    margin-bottom: 0;
}
.cta-fine b {
    background: var(--cream);
    color: var(--tomato);
    padding: 1px 6px;
    font-family: 'VT323', monospace;
    letter-spacing: 0.1em;
}

/* ───────── footer ───────── */
.footer {
    background: var(--ink);
    color: var(--cream);
    padding: 70px 40px 32px;
    position: relative;
    z-index: 2;
}
.footer-grid {
    max-width: 1200px;
    margin: 0 auto 48px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}
.footer-grid > div:first-child p {
    font-size: 14px;
    color: var(--cream-2);
    margin-top: 12px;
    max-width: 320px;
    line-height: 1.55;
}
.footer-grid h4 {
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 0.12em;
    color: var(--mustard);
    margin-bottom: 14px;
    text-transform: uppercase;
    font-weight: 400;
}
.footer-grid a {
    display: block;
    font-size: 14px;
    color: var(--cream);
    padding: 5px 0;
    transition: color .2s ease, padding-left .2s ease;
}
.footer-grid a:hover { color: var(--mustard); padding-left: 6px; }

.footer-base {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--cream-2);
    padding-top: 24px;
    font-size: 13px;
    color: var(--cream-2);
}
.footer-die {
    font-family: 'VT323', monospace;
    font-size: 22px;
    color: var(--ink);
    background: var(--mustard);
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-8deg);
    transition: transform .3s ease;
}
.footer-die:hover { transform: rotate(360deg); }

/* ───────── animations ───────── */
@keyframes shake {
    0%, 100% { transform: rotate(-6deg); }
    20% { transform: rotate(8deg); }
    40% { transform: rotate(-12deg); }
    60% { transform: rotate(15deg); }
    80% { transform: rotate(-3deg); }
}
.qc-die.rolling { animation: shake .5s ease-in-out 2; }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fade-in .5s ease forwards; }

/* ───────── responsive ───────── */
@media (max-width: 960px) {
    .hero-grid, .qs-body, .scroll-grid, .guild-grid, .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .topnav { display: none; }
    .hero { padding: 50px 24px 60px; }
    .topbar { padding: 16px 20px; }
    .scroll-section, .quest-section, .guild-section, .codex-section, .cta-section, .footer { padding-left: 20px; padding-right: 20px; }
    .scroll-body { padding: 36px 24px; }
    .codex-row { grid-template-columns: 60px 2fr 1.2fr 70px 100px; gap: 10px; padding: 12px 14px; font-size: 13px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero-meta { flex-wrap: wrap; gap: 16px; }
    .hero-right { align-items: stretch; }
    .dial { align-self: flex-end; }
}

@media (max-width: 600px) {
    .codex-row { grid-template-columns: 50px 1.6fr 1fr; }
    .codex-row > span:nth-child(4),
    .codex-row > span:nth-child(5) { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .btn-primary, .btn-ghost { justify-content: center; }
    .cta-form { flex-direction: column; border: none; gap: 12px; }
    .cta-form input { border: 1.5px solid var(--cream); }
    .cta-form button { border: 1.5px solid var(--cream); }
}
