/* Your Family Tech Value — Look Up Family. Brand colours from the official logo; Rubik like the
   Gut Check cards. Built for the booth iPad (both orientations), works on phones and laptops too. */
@font-face { font-family: Rubik; src: url(fonts/rubik-latin.woff2) format('woff2'); font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Rubik; src: url(fonts/rubik-latin-ext.woff2) format('woff2'); font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Rubik; src: url(fonts/rubik-latin-italic.woff2) format('woff2'); font-weight: 500 700; font-style: italic; font-display: swap; }

:root {
  --purple: #8967AA; --lilac: #C5AFD5; --green: #48B166; --yellow: #FDCB42; --orange: #F18931;
  --ink: #3B3350; --soft: #6E6680; --paper: #FFFDF8; --card: #FFFFFF;
  --green-ink: #2E8F4A; --orange-ink: #D96F17;
  --radius: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink);
  font-family: Rubik, "PingFang SC", "Noto Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
#rings { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 0; }

/* header: the logo top-left, four rings that fill as the steps go by */
.top { position: fixed; z-index: 3; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(26px, env(safe-area-inset-right)) 0 max(26px, env(safe-area-inset-left)); pointer-events: none; }
.logo { height: clamp(46px, 7vh, 72px); }
.progress { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; opacity: 0; transition: opacity .4s; }
body.stepping .progress { opacity: 1; }
.progress li { width: 22px; height: 22px; border-radius: 50%; border: 6px solid var(--lilac); transition: border-color .4s, transform .4s var(--ease); }
.progress li.done { border-color: var(--purple); transform: scale(1.1); }

main { position: relative; z-index: 1; height: 100dvh; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 110px max(6vw, 24px) 60px; visibility: hidden; pointer-events: none; }
.screen.on { visibility: visible; pointer-events: auto; }
/* on-screen keyboard up (keyboard() in app.js): the input screens sit at the top of what is still
   visible; on a landscape iPad (short) they also drop the heading so the field, the ideas and the
   button stay in view */
body.typing main { height: var(--vvh, 100dvh); }
body.typing .screen.has-input { justify-content: flex-start; padding-top: 12vh; }
body.typing.short .screen.has-input { padding-top: 92px; padding-bottom: 12px; }
body.typing.short .screen.has-input .kicker, body.typing.short .screen.has-input .title { display: none; }
body.typing.short .family-preview { margin-bottom: 16px; }
body.typing.short .sentence-preview { margin-bottom: 10px; }
body.typing.short .row, body.typing.short .check { margin-top: 14px; }
body.typing.short .chips { margin-top: 12px; }

.kicker { font-weight: 600; font-size: clamp(14px, 1.6vw, 18px); letter-spacing: .18em; text-transform: uppercase; color: var(--purple); margin: 0 0 18px; }
.display { font-weight: 800; font-size: clamp(46px, 7.6vw, 108px); line-height: .98; letter-spacing: -.025em; margin: 0 0 22px; max-width: 14ch; }
.title { font-weight: 800; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -.02em; margin: 0 0 26px; max-width: 18ch; }
.title b { color: var(--purple); }
.lead { font-size: clamp(18px, 2vw, 24px); line-height: 1.45; color: var(--soft); max-width: 34ch; margin: 0 0 34px; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .02em .12em; margin-bottom: -.12em; }
.ch { display: inline-block; will-change: transform; }

/* buttons */
.cta { background: var(--purple); color: #fff; font-weight: 700; font-size: clamp(20px, 2.2vw, 26px); padding: 22px 46px; border-radius: 999px;
  box-shadow: 0 10px 0 -2px #6E4F90, 0 18px 30px -12px rgba(59, 51, 80, .45); transition: transform .15s var(--ease), box-shadow .15s, opacity .3s; }
.cta:active { transform: translateY(6px) scale(.98); box-shadow: 0 4px 0 -2px #6E4F90, 0 8px 18px -10px rgba(59, 51, 80, .45); }
.cta:disabled { opacity: .35; pointer-events: none; }
.ghost { font-weight: 600; font-size: clamp(17px, 1.8vw, 21px); color: var(--purple); padding: 18px 26px; border-radius: 999px; }
.ghost:active { background: rgba(137, 103, 170, .1); }
button:focus-visible, .check input:focus-visible + .box { outline: 3px solid var(--purple); outline-offset: 3px; }   /* keyboards at home */
.row { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.col { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pulse { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* inputs */
.big-input, .mid-input, textarea { font: inherit; color: var(--ink); background: rgba(255, 255, 255, .85); border: 0; border-bottom: 5px solid var(--lilac);
  border-radius: 18px 18px 6px 6px; outline: none; text-align: center; width: min(720px, 90vw); transition: border-color .3s, background .3s; }
.big-input { font-size: clamp(30px, 4vw, 48px); font-weight: 700; padding: 16px 20px; }
.mid-input { font-size: clamp(20px, 2.2vw, 26px); padding: 14px 18px; margin-top: 14px; }
.big-input:focus, .mid-input:focus, textarea:focus { border-color: var(--purple); background: #fff; }
::placeholder { color: #B5ADC4; font-weight: 500; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.family-preview { font-weight: 800; font-size: clamp(40px, 6.4vw, 92px); letter-spacing: -.02em; margin: 0 0 34px; line-height: 1.05; max-width: 92vw; }
.family-preview .fam { color: var(--purple); display: inline-block; min-width: 2ch; }
.family-preview .the { color: var(--ink); }

/* values: 5 x 2 in landscape, 2 x 5 in portrait */
.value-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); width: min(1180px, 94vw); }
@media (orientation: portrait) { .value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(700px, 94vw); } }
.vcard { background: var(--card); border-radius: var(--radius); padding: clamp(14px, 1.8vw, 22px) clamp(12px, 1.4vw, 18px); text-align: left;
  box-shadow: 0 2px 0 rgba(59, 51, 80, .06), 0 14px 30px -18px rgba(59, 51, 80, .35); display: flex; flex-direction: column; gap: 8px; min-height: clamp(120px, 17vh, 176px); }
@media (orientation: portrait) { .vcard { flex-direction: row; align-items: center; gap: 14px; min-height: 0; } }
.vcard .ring { width: clamp(30px, 3.4vw, 42px); height: clamp(30px, 3.4vw, 42px); border-radius: 50%; border: clamp(8px, .95vw, 12px) solid var(--c); flex: none; }
.vcard b { font-size: clamp(19px, 1.9vw, 24px); font-weight: 700; display: block; }
.vcard small { font-size: clamp(13px, 1.2vw, 15px); color: var(--soft); line-height: 1.35; display: block; margin-top: 2px; }
.vcard.own-card { background: transparent; border: 3px dashed var(--lilac); box-shadow: none; }
.vcard:active { transform: scale(.97); }
.own { display: flex; flex-direction: column; align-items: center; }

/* sentence: two speech bubbles (the Gut Check "talk about" card) */
.bubbles { display: flex; gap: clamp(16px, 3vw, 40px); width: min(1100px, 92vw); }
@media (orientation: portrait) { .bubbles { flex-direction: column; } }
.bubble { position: relative; flex: 1; text-align: left; border-radius: 40px; padding: clamp(24px, 3vw, 40px); border: 5px solid var(--a); background: var(--t);
  display: flex; flex-direction: column; gap: 14px; min-height: clamp(150px, 24vh, 260px); justify-content: center; }
.bubble::after { content: ''; position: absolute; right: 70px; bottom: -34px; width: 60px; height: 40px; background: var(--t);
  border-right: 5px solid var(--a); border-bottom: 5px solid var(--a); border-radius: 0 0 60px 0; transform: skewX(30deg); }
.bubble.harder { --a: var(--orange); --t: #FEF3E9; }
.bubble.helps { --a: var(--green); --t: #EDF7F0; }
.b-kicker { font-weight: 700; font-size: clamp(13px, 1.3vw, 16px); letter-spacing: .16em; text-transform: uppercase; color: var(--orange-ink); }
.helps .b-kicker { color: var(--green-ink); }
.b-text { font-weight: 700; font-size: clamp(24px, 2.8vw, 38px); line-height: 1.15; }
.bubble:active { transform: scale(.98); }

.answer { display: flex; flex-direction: column; align-items: center; width: min(900px, 92vw); }
.sentence-preview { font-size: clamp(22px, 2.6vw, 32px); font-weight: 500; line-height: 1.3; margin: 0 0 18px; }
.sentence-preview b { color: var(--purple); }
.sentence-preview .lead-in { font-weight: 700; }
textarea { font-size: clamp(24px, 2.8vw, 34px); font-weight: 700; padding: 16px 22px; resize: none; text-align: left; width: 100%; line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.chip { background: #fff; border: 2px solid var(--lilac); border-radius: 999px; padding: 12px 20px; font-size: clamp(15px, 1.5vw, 18px); font-weight: 500; color: var(--ink); }
.chip:active { background: var(--lilac); }
.count { font-size: 14px; color: var(--soft); margin: 8px 0 0; min-height: 1em; }

/* certificate */
.cert-layout { display: flex; gap: clamp(24px, 5vw, 70px); align-items: center; justify-content: center; width: 100%; }
@media (orientation: portrait) { .cert-layout { flex-direction: column; gap: 22px; } }
.paper { height: min(72dvh, 92vw * 1.414); aspect-ratio: 210 / 297; background: #fff; border-radius: 6px; flex: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 30px 60px -20px rgba(59, 51, 80, .45); transform: rotate(-2deg); overflow: hidden; }
@media (orientation: portrait) { .paper { height: min(58dvh, 80vw * 1.414); } }
.paper canvas { width: 100%; height: 100%; display: block; }
.cert-side { text-align: left; max-width: 420px; }
.cert-side .title, .cert-side .lead { text-align: inherit; }
@media (orientation: portrait) { .cert-side { text-align: center; } }

/* email */
.check { display: flex; align-items: center; gap: 14px; font-size: clamp(18px, 2vw, 22px); font-weight: 500; margin-top: 26px; cursor: pointer; }
.check input { position: absolute; opacity: 0; }
.check .box { width: 34px; height: 34px; border-radius: 10px; border: 4px solid var(--lilac); background: #fff; flex: none; position: relative; transition: background .2s, border-color .2s; }
.check input:checked + .box { background: var(--purple); border-color: var(--purple); }
.check input:checked + .box::after { content: ''; position: absolute; left: 8px; top: 2px; width: 8px; height: 16px; border: solid #fff; border-width: 0 4px 4px 0; transform: rotate(45deg); }
.privacy { font-size: clamp(14px, 1.4vw, 16px); color: var(--soft); max-width: 46ch; line-height: 1.45; margin: 14px 0 0; }
.error { color: var(--orange-ink); font-weight: 600; margin: 12px 0 0; }

/* done */
.done-layout { display: flex; gap: clamp(30px, 6vw, 90px); align-items: center; justify-content: center; text-align: left; }
@media (orientation: portrait) { .done-layout { flex-direction: column; text-align: center; } }
.done-layout .display { max-width: 10ch; }
.tip { font-size: clamp(16px, 1.7vw, 20px); color: var(--ink); font-weight: 500; max-width: 32ch; line-height: 1.45; margin: 0 0 30px; }
.qr-card { background: #fff; border-radius: 34px; padding: 26px 26px 18px; box-shadow: 0 30px 60px -24px rgba(59, 51, 80, .45); text-align: center; }
.qr-card #qr svg { width: clamp(200px, 24vw, 280px); height: auto; display: block; }
.qr-card p { margin: 12px 0 0; font-weight: 600; color: var(--purple); }
.reset-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(197, 175, 213, .35); }
.reset-bar i { display: block; height: 100%; width: 0; background: var(--lilac); }

/* overlays */
.sending, .still { position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: rgba(255, 253, 248, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sending[hidden], .still[hidden] { display: none; }
.sending p { font-size: 22px; font-weight: 600; color: var(--purple); }
.spinner { width: 70px; height: 70px; border-radius: 50%; border: 16px solid var(--lilac); border-top-color: var(--purple); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.still-card { background: #fff; border-radius: 36px; padding: 40px 50px; text-align: center; box-shadow: 0 30px 60px -24px rgba(59, 51, 80, .45); max-width: 90vw; }
.still-card h3 { font-size: 40px; margin: 0 0 10px; font-weight: 800; }
.still-card p { font-size: 20px; color: var(--soft); margin: 0 0 24px; }

/* portrait iPad: size type by height, not the narrow width */
@media (orientation: portrait) and (min-width: 700px) {
  .display { font-size: clamp(56px, 6.2vh, 96px); }
  .title { font-size: clamp(36px, 3.7vh, 60px); }
  .lead { font-size: clamp(19px, 2vh, 26px); }
  .b-text { font-size: clamp(28px, 3vh, 42px); }
  .b-kicker { font-size: clamp(14px, 1.4vh, 18px); }
  .bubble { min-height: 0; padding: 34px 40px; }
  .vcard { padding: 20px 22px; }
  .vcard b { font-size: clamp(22px, 2.2vh, 28px); }
  .vcard small { font-size: clamp(14px, 1.35vh, 17px); }
  .chip { font-size: 18px; }
  .sentence-preview { font-size: clamp(24px, 2.5vh, 32px); }
}
@media (max-height: 640px) and (orientation: landscape) { .vcard small { display: none; } .vcard { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse, .spinner { animation: none; } }
