/* Hinna landing page. Light mode only. Calm, airy, mobile-first. System fonts only (CSP: font-src 'self'). */

:root {
  --bg: #fafafa;
  --surface: #f0f0f0;
  --ink: #121212;
  --ink-2: #6b6b6b;
  --ink-3: #a3a3a3;
  --line: #e6e6e6;
  --btn: #121212;
  --btn-ink: #fafafa;
  --btn-light: #ececec;
  --phone-frame: #1c1c1e;
  --phone-screen: #ffffff;
  --them: #e9e9eb;
  --them-ink: #111111;
  --me: #0a7cff;
  --me-ink: #ffffff;
  --serif: "New York", ui-serif, "Iowan Old Style", "Apple Garamond", Charter, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 400; }
ul, ol { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 999px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 20; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: 999px; border: 0;
  font: 500 13px/1 var(--sans); white-space: nowrap; cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-dark { background: var(--btn); color: var(--btn-ink); }
.btn-dark:hover { opacity: 0.86; }
.btn-light { background: var(--btn-light); color: var(--ink); }
.btn-light:hover { background: var(--line); }

/* ---------- header ---------- */

.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
.top-inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.top-right { justify-self: end; }
.brand { display: inline-flex; align-items: center; gap: 6px; font: 500 15px/1 var(--sans); letter-spacing: -0.01em; }
.brand { font-size: 17px; font-weight: 600; gap: 8px; }
.brand img { width: 26px; height: 26px; }

.top-left { justify-self: start; }
.brand { justify-self: center; }

/* Hamburger + dropdown menu */
.menu-btn {
  width: 38px; height: 38px; margin-left: -6px; border: 0; border-radius: 999px; background: transparent;
  display: grid; place-content: center; gap: 6px; cursor: pointer; color: var(--ink);
}
.menu-btn:hover { background: var(--btn-light); }
.menu-btn span { display: block; width: 18px; height: 1.5px; border-radius: 2px; background: currentColor; transition: transform 0.2s ease; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.menu {
  position: absolute; left: 16px; top: calc(100% - 4px); min-width: 220px; padding: 6px;
  border-radius: 16px; background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.25);
}
@media (min-width: 1152px) { .menu { left: calc((100vw - var(--max)) / 2 + 16px); } }
.menu a { display: block; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.menu a:hover, .menu a:focus-visible { background: var(--surface); }
/* Small screens: the hero button sits right below, so drop the header one to keep the logo centred. */
@media (max-width: 480px) { .top-right .btn { display: none; } }

/* ---------- hero ---------- */

.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }

.hero { position: relative; }
.hero-inner {
  max-width: var(--max); margin: 0 auto; padding: 28px 16px 56px;
  display: grid; gap: 32px; justify-items: center; align-items: center;
}
.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 7.2vw, 72px);
  line-height: 1.02; letter-spacing: -0.025em;
}
.hero-sub { color: var(--ink-2); font-size: 16px; margin: 18px 0 26px; max-width: 34ch; }

@media (max-width: 899px) {
  .hero-sub { font-size: 15px; margin: 14px 0 22px; }
  .iphone { height: 470px; }
}

@media (min-width: 900px) {
  .hero-inner { gap: 48px; padding: 56px 24px 72px; }
  .iphone { width: 290px; height: 596px; }
}

/* ---------- iPhone ---------- */

.iphone {
  margin: 0; width: 270px; height: 556px; padding: 10px; flex-shrink: 0;
  border-radius: 52px; background: var(--phone-frame);
  box-shadow:
    inset 0 0 0 2px #3a3a3c,
    0 0 0 1px var(--line),
    0 40px 80px -40px rgba(0, 0, 0, 0.45);
}
.iphone-screen {
  position: relative; height: 100%; border-radius: 42px; overflow: hidden;
  background: var(--phone-screen); display: flex; flex-direction: column;
}
.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 0; font: 600 12px/1 var(--sans); height: 40px;
}
.island { position: absolute; left: 50%; top: 10px; width: 86px; height: 25px; border-radius: 20px; background: #000; transform: translateX(-50%); }
.status-icons { display: inline-flex; gap: 3px; align-items: flex-end; }
.status-icons i { display: block; width: 4px; background: currentColor; border-radius: 1px; }
.status-icons i:nth-child(1) { height: 5px; }
.status-icons i:nth-child(2) { height: 7px; }
.status-icons i:nth-child(3) { height: 9px; }

.chat-head {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 0 10px; border-bottom: 1px solid var(--line);
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
}
.avatar img { width: 40px; height: 40px; }
.chat-name { font-size: 11px; font-weight: 500; }

.thread {
  flex: 1; overflow: hidden; padding: 12px 10px 16px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 5px;
}
.thread > li { flex-shrink: 0; }
.msg {
  max-width: 80%; padding: 7px 11px; border-radius: 17px;
  font-size: 13px; line-height: 1.32; overflow-wrap: anywhere;
}
.them { align-self: flex-start; background: var(--them); color: var(--them-ink); border-bottom-left-radius: 5px; }
.me { align-self: flex-end; background: var(--me); color: var(--me-ink); border-bottom-right-radius: 5px; }
.stamp { align-self: center; font-size: 10px; color: var(--ink-2); margin: 6px 0 2px; }

.typing { display: inline-flex; gap: 4px; padding: 11px 13px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

/* Animation (landing.js): bubbles grow from their tail corner, glide up, and fade out under the top edge. */
.thread > li.them { transform-origin: bottom left; }
.thread > li.me { transform-origin: bottom right; }
.thread > li.stamp { transform-origin: center bottom; }
.js .thread {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 36px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 36px);
}
.js .thread > li { will-change: transform, opacity; }
.js .thread.is-fading > li { opacity: 0; transition: opacity 0.6s ease; }

/* ---------- sections below the hero ---------- */

.section { max-width: var(--max); margin: 0 auto; padding: 88px 16px; }
.section-head { text-align: center; margin-bottom: 40px; }
.section .eyebrow { max-width: none; margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.section h2, .cta h2 {
  font-family: var(--serif); font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.02em;
}
.section h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.section p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); max-width: 34ch; }

/* Small static chat snippets inside cards */
.mini-thread { display: flex; flex-direction: column; gap: 5px; margin-top: auto; padding-top: 22px; }
.mini-thread .msg { font-size: 13px; max-width: 88%; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.mini-thread .them { background: #fff; }

/* Steps */
.steps-row { display: grid; gap: 12px; counter-reset: none; }
.step-card {
  display: flex; flex-direction: column; min-height: 260px; padding: 24px;
  border-radius: 24px; background: var(--surface);
}
.step-card .mini-thread .them { background: #fff; }
.step-no {
  display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 18px; border-radius: 50%;
  background: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.source-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 22px; }
.source-chips span { padding: 6px 10px; border-radius: 999px; background: #fff; font-size: 12px; color: var(--ink-2); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }

/* Bento: soft tints taken from the logo */
.bento { display: grid; gap: 12px; }
.tile { display: flex; flex-direction: column; min-height: 240px; padding: 24px; border-radius: 24px; overflow: hidden; }
.tile-blue { background: linear-gradient(150deg, #e3f2fd 0%, #eef6ff 60%, #f6f9ff 100%); }
.tile-pink { background: linear-gradient(150deg, #fde7f3 0%, #fff0f7 100%); }
.tile-yellow { background: linear-gradient(150deg, #fbf6d9 0%, #fffbe9 100%); }
.tile-lilac { background: linear-gradient(150deg, #ece9f8 0%, #f4f2fc 100%); }
.memory { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 22px; }
.memory li {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85); font-size: 13px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.memory li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #8b7fd6; }

@media (min-width: 760px) {
  .section { padding: 120px 24px; }
  .section-head { margin-bottom: 56px; }
  .steps-row { grid-template-columns: repeat(3, 1fr); }
  .bento { grid-template-columns: repeat(3, 1fr); }
  .tile-wide { grid-column: span 2; flex-direction: row; align-items: flex-end; gap: 24px; }
  .tile-wide .tile-text { flex: 1; align-self: flex-start; }
  .tile-wide .mini-thread, .tile-wide .memory { flex: 1; margin-top: 0; padding-top: 0; }
  .tile-wide .memory { justify-content: flex-end; align-content: flex-end; }
}

/* Closing call to action */
.cta { max-width: var(--max); margin: 0 auto; padding: 0 16px 96px; }
.cta-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 64px 24px; border-radius: 32px; background: var(--surface);
}
.cta-card img { margin-bottom: 24px; }
.cta-card p { margin: 14px 0 26px; font-size: 15px; color: var(--ink-2); max-width: 40ch; }
@media (min-width: 760px) { .cta { padding: 0 24px 120px; } .cta-card { padding: 88px 24px; } }

/* ---------- footer ---------- */

.foot { background: var(--surface); }
.foot-inner {
  max-width: 760px; margin: 0 auto; padding: 56px 16px 64px;
  display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  font-size: 12px;
}
.foot h3 { font-size: 11px; color: var(--ink-2); margin-bottom: 14px; }
.foot li + li { margin-top: 6px; }
.foot a:hover { text-decoration: underline; }
.foot-copy { grid-column: 1 / -1; color: var(--ink-2); margin: 16px 0 0; font-size: 11px; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- waitlist sign-up (/vantelista) and log in (/logga-in) ---------- */

[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.flow-page { min-height: 100svh; display: flex; flex-direction: column; }
.flow-top { display: flex; justify-content: center; padding: 16px; }
.flow { flex: 1; display: grid; place-items: center; padding: 24px 16px 15vh; }
.flow-card { width: 100%; max-width: 340px; margin: 0; padding: 0; border: 0; }
.flow-title { font-family: var(--serif); font-size: 26px; line-height: 1.15; letter-spacing: -0.015em; }
.flow-title-icon { display: flex; align-items: center; gap: 10px; }
.imsg-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: linear-gradient(180deg, #5ef777, #1fc93e); }
.flow-sub { color: var(--ink-2); font-size: 14px; margin: 8px 0 24px; }

.phone-field {
  display: flex; align-items: center; height: 48px; border: 1px solid #d9d9d9; border-radius: 12px; background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.phone-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.06); }
.phone-field select {
  height: 100%; padding: 0 8px 0 12px; border: 0; border-right: 1px solid var(--line); border-radius: 12px 0 0 12px;
  background: transparent; font: 14px var(--sans); color: var(--ink); cursor: pointer;
}
.phone-field input { flex: 1; min-width: 0; height: 100%; padding: 0 14px; border: 0; background: transparent; font: 16px var(--sans); color: var(--ink); }
.phone-field select:focus-visible, .phone-field input:focus-visible { outline: none; }
.phone-field input::placeholder { color: var(--ink-3); }

.turnstile { margin-top: 16px; min-height: 65px; }
.flow-error { min-height: 20px; margin: 10px 0 6px; font-size: 13px; color: #c62828; }
.btn-block { width: 100%; height: 46px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.flow-legal { margin: 18px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-2); }
.flow-legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 0; padding: 0; border: 0; }
.otp input {
  width: 100%; height: 56px; padding: 0; text-align: center; border: 1px solid #d9d9d9; border-radius: 12px; background: #fff;
  font: 500 22px var(--sans); color: var(--ink); caret-color: var(--ink);
}
.otp input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.06); }
.otp.is-wrong input { border-color: #e57373; animation: shake 0.3s ease; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.resend summary { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); cursor: pointer; list-style: none; }
.resend summary::-webkit-details-marker { display: none; }
.resend summary::after { content: "›"; font-size: 16px; line-height: 1; transition: transform 0.15s ease; }
.resend[open] summary::after { transform: rotate(90deg); }
.resend p { font-size: 13px; color: var(--ink-2); margin: 10px 0 12px; }
.resend-actions { display: flex; gap: 8px; }

/* text-first sign-up: open Messages, then wait for the person's message */
a.btn-block { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.flow-card:focus { outline: none; }
.wait { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; font-size: 13px; color: var(--ink-2); }
.wait-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--me); animation: pulse 1.4s infinite ease-in-out; }
.wait.is-late .wait-dot { background: var(--ink-3); }
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }
.line-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.line-box span { flex-basis: 100%; font-size: 12px; }
.line-box strong { flex: 1; font: 500 16px var(--sans); color: var(--ink); white-space: nowrap; }
.help-list { margin: 0 0 14px; padding-left: 18px; list-style: disc; font-size: 13px; color: var(--ink-2); }
.help-list li { margin: 6px 0; }

.flow-done { display: flex; flex-direction: column; align-items: center; text-align: center; }
.flow-done:focus { outline: none; }
.flow-done img { margin-bottom: 18px; }
.flow-done .flow-sub { margin-bottom: 22px; }
.flow-done .flow-error { margin-top: 14px; }
.flow-done .resend-actions { justify-content: center; }
.flow-confirm { font-size: 14px; margin: 0 0 14px; }

/* ---------- profile: connectors (/logga-in, logged-in users) ---------- */

.flow-profile { max-width: 520px; }
.flow-profile:focus { outline: none; }
.profile-h { font: 600 15px var(--sans); margin: 8px 0 0; }
.flow-profile .flow-error:empty { min-height: 0; margin: 6px 0 0; }
.connectors-note { font-size: 14px; color: var(--ink-2); margin: 12px 0; }
.connectors { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.connector { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.connector-badge {
  flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface); font: 600 15px var(--sans); color: var(--ink);
}
.connector-body { flex: 1; min-width: 0; }
.connector-name { font: 500 15px var(--sans); margin: 0; }
.connector-desc { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; }
.connector-account { font-size: 13px; color: var(--ink); margin: 8px 0 0; overflow-wrap: anywhere; }
.connector-account.is-warning { color: #b25e00; }
.connector-actions { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 420px) {
  .connector { flex-wrap: wrap; }
  .connector-actions { flex-direction: row; width: 100%; padding-left: 46px; align-items: center; }
}
/* Passkeys on /logga-in */
.flow-stack { display: flex; flex-direction: column; gap: 10px; }
.flow-link {
  align-self: center; background: none; border: 0; padding: 6px; cursor: pointer;
  font: 500 14px var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 2px;
}
.btn-passkey { margin-top: 10px; }
.text-field {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); font: 500 16px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase;
}
.text-field:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.06); }
.recovery-codes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin: 0 0 16px; padding: 14px 16px 14px 34px;
  border: 1px solid var(--line); border-radius: 12px; font: 500 15px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em;
}
.flow-check { display: flex; align-items: center; gap: 8px; margin: 16px 0 4px; font-size: 14px; }
.flow-notice { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: #fff4e0; color: #6b4200; font-size: 14px; }
.flow-notice p { margin: 0 0 10px; }
.security-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 0; }
.security-codes { margin: 0; font-size: 14px; color: var(--ink-2); }
@media (max-width: 380px) { .recovery-codes { grid-template-columns: 1fr; } }
