/* GridCast.my – styles
   Palette: warm cream paper, deep plum ink, purple, orange, sky blue.
   Type: Fraunces (soft serif headlines), Figtree (UI), Caveat (handwritten notes). */

@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('../assets/fonts/figtree-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('../assets/fonts/figtree-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('../assets/fonts/figtree-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('../assets/fonts/figtree-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('../assets/fonts/figtree-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('../assets/fonts/caveat-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('../assets/fonts/caveat-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --cream: #FFF7EE; --paper: #FFFCF8; --ink: #261A47; --ink-soft: #62597F; --ink-faint: #9A93B2;
  --line: rgba(38, 26, 71, .12);
  --purple: #6B4EE6; --purple-deep: #3D2B94; --night: #2A1E66; --lilac: #E8E2FC;
  --orange: #FF7A2F; --orange-deep: #E8590C; --peach: #FFE2CC;
  --sky: #7CC7EE; --sky-deep: #3FA3DB; --sky-pale: #DFF2FC;
  --ok: #1FA38A; --watch: #F2B01E; --alert: #E0386B; --info: #6B4EE6;
  --r: 22px; --shadow: 0 1px 0 rgba(38,26,71,.04), 0 10px 28px -12px rgba(61, 43, 148, .22);
  --serif: 'Fraunces', Georgia, serif; --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; --hand: 'Caveat', 'Segoe Script', cursive;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); line-height: 1.5; font-size: 15.5px; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 480px at 92% -8%, rgba(124,199,238,.38), transparent 60%),
    radial-gradient(760px 420px at -6% 8%, rgba(255,122,47,.16), transparent 60%),
    radial-gradient(700px 500px at 60% 108%, rgba(107,78,230,.10), transparent 60%),
    var(--cream);
  background-attachment: fixed; min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
p { margin: 0; }
a { color: var(--purple); }
button { font-family: inherit; cursor: pointer; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.hand { font-family: var(--hand); font-weight: 700; color: var(--orange-deep); font-size: 21px; line-height: 1.1; }
.muted { color: var(--ink-soft); }
.tiny { font-size: 12.5px; color: var(--ink-soft); }
.num { font-family: var(--serif); font-variation-settings: 'SOFT' 100, 'WONK' 0; font-feature-settings: 'lnum'; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; padding: 14px 0 6px; background: linear-gradient(var(--cream) 62%, rgba(255,247,238,0)); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.logo svg { width: 42px; height: 42px; flex: none; }
.logo-word { font-family: var(--serif); font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variation-settings: 'SOFT' 100, 'WONK' 1; line-height: 1; }
.logo-word i { font-style: normal; color: var(--orange-deep); font-weight: 600; }
.nav { display: flex; gap: 4px; background: rgba(255,252,248,.8); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px; backdrop-filter: blur(6px); }
.nav button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--ink-soft); position: relative; transition: .15s; }
.nav button:hover { color: var(--ink); background: var(--lilac); }
.nav button.on { background: var(--ink); color: var(--cream); }
.nav button .dotbadge { position: absolute; top: 4px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--alert); border: 2px solid var(--paper); }
.who { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 14px 5px 5px; font-weight: 700; font-size: 14px; color: var(--ink); }
.who:hover { border-color: var(--purple); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 16px; }
.who small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 11.5px; line-height: 1.1; }

/* ---------- demo clock ---------- */
.clock { margin: 8px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 11px 16px 11px 14px; border-radius: 18px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 10px, rgba(255,255,255,.3) 10px 20px), var(--lilac); border: 1.8px dashed rgba(107,78,230,.5); }
.clock-tag { font-family: var(--hand); font-weight: 700; font-size: 20px; color: var(--purple-deep); transform: rotate(-2deg); display: flex; align-items: center; gap: 6px; }
.clock label { font-size: 12px; font-weight: 700; color: var(--ink-soft); display: flex; flex-direction: column; gap: 2px; }
.clock input[type=date], .clock select { font: inherit; font-weight: 600; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.clock input[type=range] { width: 150px; accent-color: var(--orange); }
.btn-play { border: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px -4px rgba(232,89,12,.6); transition: .15s; }
.btn-play:hover { transform: scale(1.06); background: var(--orange-deep); }
.btn-play svg { width: 18px; height: 18px; }
.jumps { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chipbtn { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; color: var(--ink); }
.chipbtn:hover { border-color: var(--purple); color: var(--purple-deep); }
.chipbtn.accent { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.clock-read { font-family: var(--serif); font-weight: 600; font-size: 19px; }
.clock-note { width: 100%; font-size: 12.5px; color: var(--ink-soft); }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.chk input { accent-color: var(--orange); }

/* ---------- layout bits ---------- */
main { padding: 10px 0 70px; min-height: 70vh; }
.grid { display: grid; gap: 20px; }
.g-hero { grid-template-columns: 1.55fr 1fr; align-items: stretch; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g-wide { grid-template-columns: 1.4fr 1fr; }
.sec { margin: 38px 0 14px; }
.sec h2 { font-size: 29px; display: inline-block; position: relative; padding-bottom: 8px; }
.sec h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='9' viewBox='0 0 60 9'%3E%3Cpath d='M1 5c4-5 8-5 12 0s8 5 12 0 8-5 12 0 8 5 12 0 8-5 10-1' fill='none' stroke='%23FF7A2F' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left bottom / 60px 9px; }
.sec p { margin-top: 6px; color: var(--ink-soft); max-width: 70ch; }
.card { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); }
.card.tilt { transform: rotate(-.7deg); } .card.tilt2 { transform: rotate(.6deg); }
.card h3 { font-size: 19px; margin-bottom: 4px; }
.label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.stat-big { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1.1; margin: 6px 0 2px; font-variation-settings: 'SOFT' 100, 'WONK' 0; }
.stat-sub { font-size: 13.5px; color: var(--ink-soft); }
.good { color: var(--ok); font-weight: 700; } .bad { color: var(--alert); font-weight: 700; }
.sky { background: var(--sky-pale); border-color: rgba(63,163,219,.3); } .lilac { background: var(--lilac); border-color: rgba(107,78,230,.25); } .peach { background: var(--peach); border-color: rgba(232,89,12,.25); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 30px 30px 30px 8px; padding: 34px 38px 30px; color: var(--cream);
  background: radial-gradient(520px 260px at 100% 0, rgba(255,122,47,.55), transparent 70%), radial-gradient(420px 300px at 0 110%, rgba(124,199,238,.38), transparent 70%), var(--night);
  box-shadow: 0 24px 44px -22px rgba(42,30,102,.65); }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .22; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,.9) 1.4px, transparent 1.6px); background-size: 26px 26px; mask-image: linear-gradient(120deg, transparent 35%, #000 100%); -webkit-mask-image: linear-gradient(120deg, transparent 35%, #000 100%); }
.hero > * { position: relative; }
.hero .label { color: rgba(255,247,238,.78); }
.hero-num { font-family: var(--serif); font-size: clamp(64px, 9vw, 104px); font-weight: 600; line-height: 1; margin: 8px 0 4px; letter-spacing: -.03em; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.hero-num small { font-size: 26px; font-weight: 500; opacity: .85; margin-left: 8px; letter-spacing: 0; }
.hero p.msg { font-size: 17px; max-width: 46ch; color: rgba(255,247,238,.94); margin-top: 10px; }
.sticker { display: inline-block; transform: rotate(-3deg); font-weight: 800; font-size: 14px; padding: 7px 16px; border-radius: 12px 14px 12px 10px; color: var(--ink); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.sticker.ok { background: #8CE3CF; } .sticker.watch { background: #FFD66B; } .sticker.alert { background: #FF8FB1; } .sticker.info { background: var(--lilac); }
.hero .hand { color: #FFB27F; position: absolute; right: 30px; bottom: 22px; text-align: right; transform: rotate(-3deg); max-width: 210px; font-size: 22px; }
.side-stack { display: grid; gap: 20px; grid-template-rows: auto auto 1fr; }
.weather { display: flex; align-items: center; gap: 14px; }
.weather svg { width: 46px; height: 46px; flex: none; }

/* ---------- lists / rows ---------- */
.todo { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.todo li { display: flex; gap: 12px; align-items: flex-start; }
.todo .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-top: 1px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 18px; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line); margin-bottom: 10px; }
.row b { font-weight: 700; } .row .tiny { display: block; margin-top: 1px; }
.tag { white-space: nowrap; font-weight: 800; font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1.8px solid var(--ink); color: var(--ink); }
.tag.alert { background: #FF8FB1; } .tag.watch { background: #FFD66B; } .tag.ok { background: #8CE3CF; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1.5px dashed var(--line); }
.line:last-child { border-bottom: 0; } .line small { display: block; color: var(--ink-soft); font-size: 12.5px; }
.line.total { font-family: var(--serif); font-size: 21px; font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 14px; }
.moneybar { display: flex; height: 22px; border-radius: 12px; overflow: hidden; border: 1.8px solid var(--ink); margin: 14px 0 10px; background: var(--paper); }
.moneybar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-soft); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; border: 1.5px solid var(--ink); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); padding: 8px 10px; border-bottom: 2px solid var(--ink); }
.tbl td { padding: 9px 10px; border-bottom: 1.5px dashed var(--line); } .tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.best td { background: rgba(31,163,138,.12); font-weight: 700; } .tbl tr.on td { background: var(--lilac); font-weight: 700; }

/* ---------- controls ---------- */
.seg { display: inline-flex; border: 1.8px solid var(--ink); border-radius: 999px; padding: 3px; background: var(--paper); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.seg button.on { background: var(--ink); color: var(--cream); }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pick { text-align: left; border: 1.8px solid var(--line); background: var(--paper); border-radius: 20px; padding: 16px 18px; transition: .15s; color: var(--ink); }
.pick:hover { border-color: var(--purple); transform: translateY(-2px); }
.pick.on { border-color: var(--ink); background: var(--peach); box-shadow: 4px 4px 0 var(--ink); }
.pick b { font-family: var(--serif); font-size: 18px; display: block; margin-bottom: 4px; } .pick span { font-size: 13.5px; color: var(--ink-soft); }
.field { display: grid; gap: 6px; margin-bottom: 14px; } .field > span { font-weight: 700; font-size: 13.5px; }
.field small { color: var(--ink-soft); font-size: 12.5px; }
input[type=text], input[type=number], input[type=date], select.sel { font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; width: 100%; }
input:focus, select:focus { outline: 2.5px solid rgba(107,78,230,.35); border-color: var(--purple); }
input[type=range] { width: 100%; accent-color: var(--orange); }
.range-row { display: flex; align-items: center; gap: 12px; } .range-row b { min-width: 74px; text-align: right; font-family: var(--serif); font-size: 18px; }
.btn { border: 2px solid var(--ink); background: var(--orange); color: #fff; font-weight: 800; padding: 10px 20px; border-radius: 14px 16px 14px 12px; box-shadow: 3px 3px 0 var(--ink); transition: .12s; font-size: 15px; }
.btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: var(--paper); color: var(--ink); } .btn.small { padding: 7px 14px; font-size: 13.5px; }
.chart-box { position: relative; height: 330px; } .chart-box.tall { height: 380px; } .chart-box.short { height: 240px; }
.callout { position: relative; padding: 16px 20px 16px 52px; border-radius: 18px; background: var(--sky-pale); border: 1.8px solid rgba(63,163,219,.4); }
.callout::before { content: '★'; position: absolute; left: 18px; top: 13px; font-size: 22px; color: var(--orange); }
.saving { background: linear-gradient(135deg, #D8F5EC, #EFFBF6); border: 1.8px solid rgba(31,163,138,.45); border-radius: 26px 26px 26px 8px; padding: 26px 30px; }
.saving .big { font-family: var(--serif); font-size: 58px; font-weight: 600; color: #0D7A67; line-height: 1; letter-spacing: -.02em; }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(38,26,71,.45); z-index: 60; backdrop-filter: blur(2px); animation: fade .18s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--cream); z-index: 61; padding: 26px 28px 40px; overflow-y: auto; box-shadow: -24px 0 50px -20px rgba(38,26,71,.5); animation: slide .22s ease-out; border-left: 2px solid var(--ink); }
.drawer h2 { font-size: 30px; margin-bottom: 4px; }
.modal { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(640px, 94vw); max-height: 92vh; overflow: auto; background: var(--cream); border: 2px solid var(--ink); border-radius: 30px 30px 30px 8px; padding: 30px 34px; box-shadow: 8px 8px 0 var(--ink); animation: pop .22s ease-out; }
.fold { border: 1.5px solid var(--line); border-radius: 16px; padding: 4px 16px; background: var(--paper); margin-bottom: 12px; }
.fold summary { cursor: pointer; font-weight: 800; padding: 12px 0; font-family: var(--serif); font-size: 18px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 13px 22px; border-radius: 16px; font-weight: 700; box-shadow: 0 16px 36px -12px rgba(0,0,0,.5); animation: pop .2s ease-out; display: flex; gap: 10px; align-items: center; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.steps .st { position: relative; padding: 18px 18px 16px; border-radius: 20px; border: 1.8px solid var(--ink); background: var(--paper); }
.steps .st:nth-child(1) { background: var(--sky-pale); } .steps .st:nth-child(2) { background: var(--lilac); } .steps .st:nth-child(3) { background: var(--peach); } .steps .st:nth-child(4) { background: #D8F5EC; }
.steps .st b { font-family: var(--serif); font-size: 18px; display: block; margin: 8px 0 4px; }
.steps .st .no { font-family: var(--hand); font-size: 30px; font-weight: 700; color: var(--orange-deep); line-height: 1; }
footer { border-top: 2px dashed var(--line); padding: 26px 0 50px; color: var(--ink-soft); font-size: 13.5px; }
@keyframes fade { from { opacity: 0 } } @keyframes slide { from { transform: translateX(40px); opacity: 0 } } @keyframes pop { from { opacity: 0; transform: translate(-50%,-46%) scale(.97) } }
.toast { animation-name: pop2; } @keyframes pop2 { from { opacity: 0; transform: translate(-50%, 14px) } }
@media (max-width: 980px) {
  .g-hero, .g2, .g3, .g4, .g-wide, .picks, .steps { grid-template-columns: 1fr; }
  .nav { overflow-x: auto; max-width: 100%; } .top-inner { flex-wrap: wrap; } .hero .hand { position: static; margin-top: 12px; }
  .jumps { margin-left: 0; }
}

/* custom range sliders */
input[type=range] { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--lilac), var(--sky-pale)); border: 1.5px solid var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: grab; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--orange); border: 2.5px solid var(--ink); cursor: grab; }
.clock input[type=range] { width: 130px; }
.nav button { white-space: nowrap; flex: none; }
