/* Happy Hacks brand system */
:root {
  --plum: #493C55;        /* Deep Plum: headings, buttons, footer */
  --lavender: #B8A6CE;    /* Dusty Lavender: the H, accents */
  --lavender-ink: #7A6696;/* lavender dark enough for text on cream */
  --sage: #B7C7B0;        /* Muted Sage */
  --peach: #EBC8B7;       /* Soft Peach */
  --cream: #FAF7F2;       /* Warm Cream: page */
  --white: #FFFDF9;
  --ink: #493C55;
  --muted: #6E6378;
  --line: #ECE5DA;
  --radius: 22px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--cream); color: var(--ink); font: 400 17px/1.65 Nunito, system-ui, sans-serif; }
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, .brand { font-family: Fredoka, Nunito, sans-serif; color: var(--plum); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* nav */
.nav-bar { background: color-mix(in srgb, var(--cream) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid transparent; }
.nav { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; padding-bottom: 16px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 24px; letter-spacing: -.01em; white-space: nowrap; }
.nav nav { display: flex; align-items: center; gap: 22px; }
.nav nav a:not(.btn) { text-decoration: none; color: var(--plum); font-weight: 600; font-size: 15px; }
.nav nav a:not(.btn):hover { color: var(--lavender-ink); }

/* buttons + pills */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--plum); color: var(--cream); padding: 13px 26px; border-radius: 999px; text-decoration: none; font-weight: 700; transition: transform .15s, box-shadow .15s; box-shadow: 0 6px 18px -8px rgba(73,60,85,.6); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(73,60,85,.6); }
.btn-sm { padding: 8px 18px; font-size: 15px; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--lavender) 35%, var(--white)); color: var(--plum); }

/* hero */
.hero { padding: 40px 0 72px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 32px; }
.hero h1 { font-size: clamp(42px, 6.4vw, 76px); line-height: 1.02; font-weight: 700; margin: 0 0 14px; letter-spacing: -.02em; }
.tagline { font-family: Fredoka, sans-serif; font-weight: 500; font-size: 24px; color: var(--lavender-ink); margin: 0 0 18px; }
.lede { font-size: 19px; color: var(--muted); max-width: 34em; margin: 0 0 28px; }
.hero-art { position: relative; aspect-ratio: 768 / 548; }
.hero-art img { position: relative; z-index: 1; width: 100%; }
.blob { position: absolute; border-radius: 50% 46% 54% 48% / 52% 50% 50% 48%; z-index: 0; }
.blob-lav { inset: 18% -6% -10% 22%; background: color-mix(in srgb, var(--lavender) 45%, var(--cream)); }
.blob-sage { width: 32%; height: 34%; right: -8%; top: -6%; background: color-mix(in srgb, var(--sage) 70%, var(--cream)); border-radius: 60% 40% 55% 45%; }
.blob-peach { width: 22%; height: 30%; right: -10%; bottom: 8%; background: color-mix(in srgb, var(--peach) 75%, var(--cream)); border-radius: 50% 40% 60% 45%; }

/* apps */
.apps { background: var(--white); padding: 72px 0 88px; border-top: 1px solid var(--line); }
.eyebrow { font-family: Fredoka, sans-serif; text-transform: uppercase; letter-spacing: .14em; font-size: 14px; font-weight: 600; color: var(--lavender-ink); margin: 0 0 6px; }
.eyebrow a { text-decoration: none; }
.apps h2 { font-size: clamp(30px, 4vw, 42px); margin: 0 0 32px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card { position: relative; display: block; background: var(--cream); border-radius: var(--radius); padding: 28px 28px 26px; text-decoration: none; border: 1px solid var(--line); overflow: hidden; transition: transform .18s, box-shadow .18s; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--lavender); }
.card-1::before { background: var(--sage); }
.card-2::before { background: var(--peach); }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -20px rgba(73,60,85,.45); }
.card h3 { font-size: 30px; font-weight: 700; margin: 14px 0 6px; }
.card p { color: var(--muted); margin: 0 0 18px; }
.more { font-weight: 700; color: var(--plum); }

/* inner pages */
.page { padding: 64px 0 96px; }
.page h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.04; margin: 6px 0 12px; font-weight: 700; letter-spacing: -.02em; }

/* footer */
.foot { background: var(--plum); color: var(--cream); padding: 36px 0; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.brand-light span { color: var(--cream); }
.foot-tag { font-family: Fredoka, sans-serif; color: var(--lavender); margin: 0; font-size: 18px; }
.foot-copy { margin: 0; font-size: 14px; color: color-mix(in srgb, var(--cream) 70%, var(--plum)); }

@media (max-width: 820px) {
  .hero { padding-top: 16px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 520px; margin: 0 auto; width: 100%; }
  .nav nav a:not(.btn) { display: none; }
  .brand { font-size: 21px; }
}

/* admin */
.admin-narrow { max-width: 420px; }
.admin-page { padding-top: 40px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-title { font-size: 40px; font-weight: 700; margin: 0 0 12px; }
.admin-mark { margin-bottom: 8px; }
.admin-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 12px 30px -24px rgba(73,60,85,.5); }
.admin-card form { display: grid; gap: 10px; }
.admin-card label { font-weight: 700; font-size: 15px; }
.admin-card input[type=password] { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink); }
.admin-card input[type=password]:focus { outline: 2px solid var(--lavender); border-color: var(--lavender); }
.admin-card .btn { justify-content: center; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.admin-card .btn:disabled { opacity: .5; cursor: default; transform: none; }
.admin-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-card-head h2 { margin: 0; font-size: 24px; }
.admin-card h3 { font-size: 15px; margin: 14px 0 4px; }
.sp { flex: 1; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--lavender-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--lavender) 30%, var(--white)); color: var(--plum); }
.tag.ok { background: color-mix(in srgb, var(--sage) 60%, var(--white)); }
.tag.warn { background: color-mix(in srgb, var(--peach) 75%, var(--white)); }
.tag.bad { background: #F6D9D6; color: #8A2E26; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.commits { margin: 0 0 12px; padding-left: 18px; font-size: 15px; }
.row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.updlog { background: var(--plum); color: var(--cream); border-radius: 14px; padding: 14px 16px; max-height: 420px; overflow: auto; white-space: pre-wrap; font-size: 13px; margin: 16px 0 0; }
.msg { border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.msg.err { background: #F6D9D6; color: #8A2E26; }
.hint { color: var(--muted); font-size: 14px; margin: 16px 0 0; }

/* accounts */
.nav .nav-signin { font-weight: 700 !important; }
.acct-narrow { max-width: 460px; }
.acct-wide { max-width: 920px; }
.acct-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: 0 12px 30px -24px rgba(73,60,85,.5); }
.acct-card h2 { font-size: 22px; margin: 0 0 12px; }
.acct-center { text-align: center; }
.acct-mark { margin-bottom: 6px; }
.acct-center .acct-mark { margin: 0 auto 6px; }
.acct-title { font-size: 34px; line-height: 1.1; font-weight: 700; margin: 0 0 8px; }
.acct-sub { color: var(--muted); margin: 0 0 16px; }
.acct-note { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.acct-note a { color: var(--lavender-ink); font-weight: 700; }
.acct-form { display: grid; gap: 8px; }
.acct-form label { font-weight: 700; font-size: 15px; margin-top: 4px; }
.acct-form .btn { margin-top: 10px; justify-content: center; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.acct-card input[type=text], .acct-card input:not([type]), .acct-card .codeinp { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink); min-width: 0; }
.acct-card input:focus { outline: 2px solid var(--lavender); border-color: var(--lavender); }
.codeinp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; font-size: 22px !important; letter-spacing: 6px; }
.acct-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.acct-inline input { flex: 1 1 200px; }
.acct-inline .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.acct-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.acct-row form { margin: 0; }
.acct-row .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.acct-hello { font-size: clamp(36px, 5vw, 52px); margin: 4px 0 18px; font-weight: 700; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 8px; }
.acct-apps { list-style: none; padding: 0; margin: 0; }
.acct-apps li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 700; }
.bigcode { font: 700 42px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 6px; margin: 16px 0; color: var(--plum); }
.btn-ghost { background: transparent; color: var(--plum); box-shadow: inset 0 0 0 2px var(--plum); border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.inline { display: inline; margin-left: 8px; }
.muted { color: var(--muted); }
.msg.ok { background: color-mix(in srgb, var(--sage) 45%, var(--white)); color: #2F4A2A; }
.msg.info { background: color-mix(in srgb, var(--lavender) 25%, var(--white)); color: var(--plum); }
.msg { margin: 0 0 14px; }
@media (max-width: 820px) { .nav .nav-signin { display: inline !important; } }
