/*
 * qoreen.com. Colours are apps/mobile/tokens.js, in the pairings docs/brand-tokens.md allows.
 * Fonts are OFL, self-hosted from @expo-google-fonts; licences sit beside them in /fonts.
 */

@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('/fonts/BalooBhaijaan2-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/PlusJakartaSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/PlusJakartaSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* Light roles */
  --background: #fbf7ee; /* kertas-50 */
  --surface: #f3e9d2; /* santan-100 */
  --text: #1b2233; /* dakwat-900 */
  --heading: #14213d; /* malam-800 */
  --muted: #5b6375; /* kabus-600 */
  --divider: #e7ddc7; /* pasir-200, decoration only */
  --control: #857e70; /* pasir-500, outlines only */
  --accent: #14213d; /* malam-800 */
  --on-accent: #fbf7ee; /* kertas-50 */
  --field: #fbf7ee;
  --success: #237553; /* daun-600 */
  --error: #c2412d; /* saga-600 */

  --heading-font: 'Baloo Bhaijaan 2', system-ui, sans-serif;
  --body-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #14213d; /* malam-800 */
    --surface: #1b2233; /* dakwat-900 */
    --text: #f3e9d2; /* santan-100 */
    --heading: #f3e9d2;
    --muted: #a9b1c4; /* kabus-300 */
    --divider: #6a7ba3; /* malam-400 */
    --control: #6a7ba3;
    --accent: #f2b544; /* api-500 */
    --on-accent: #14213d;
    --field: #1b2233;
    --success: #5cc394; /* daun-300 */
    --error: #f07a63; /* saga-300 */
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

main {
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Header and footer, shared by every page */

.site-header {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}
.site-header .wordmark {
  font-family: var(--heading-font);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--heading);
  text-decoration: none;
}

.site-footer {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer a {
  display: inline-block;
  padding: 0.25rem 0;
}

/* Homepage */

.home {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.home .wordmark {
  margin: 0;
  font-family: var(--heading-font);
  font-weight: 800;
  font-size: clamp(3.25rem, 12vw, 5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--heading);
}

.tagline {
  margin: 1rem 0 0;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  line-height: 1.35;
}

.soon {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.signin-use {
  max-width: 34rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.join {
  margin-top: 2.5rem;
  max-width: 30rem;
}

.join label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
}

.join-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.join input[type='email'] {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--control);
  border-radius: 0.5rem;
  background: var(--field);
  color: var(--text);
  font: inherit;
}
.join input[type='email']:focus-visible {
  outline-offset: 1px;
}
.join input[aria-invalid='true'] {
  border-color: var(--error);
}

.join button {
  flex: 0 0 auto;
  min-height: 3rem;
  padding: 0.625rem 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.join button:disabled {
  cursor: progress;
}

@media (max-width: 30rem) {
  .join button {
    flex-basis: 100%;
  }
}

.notice {
  margin: 0.875rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Results. The plain-post ones show when the address bar's anchor names them. */
/* The live region stays rendered even when empty, or some screen readers miss what is written to it. */
.result {
  display: none;
}
.result:target {
  display: block;
}
.join.sent .result {
  display: none;
}
.result,
.status {
  margin: 1rem 0 0;
  font-weight: 700;
}
.status:empty {
  margin: 0;
}
.success {
  color: var(--success);
}
.error {
  color: var(--error);
}

/* Honeypot: off screen rather than display:none, which some bots skip. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Long text: /privacy and /terms */

.legal {
  padding-top: 2.5rem;
  padding-bottom: 1rem;
  overflow-wrap: break-word;
}

.legal h1,
.legal h2 {
  font-family: var(--heading-font);
  font-weight: 800;
  color: var(--heading);
  line-height: 1.2;
}
.legal h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 7vw, 2.5rem);
}
.legal h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.5rem;
}
.legal h3,
.legal h4 {
  margin: 1.75rem 0 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--heading);
}
.legal h4 {
  font-size: 1rem;
}

.legal p,
.legal ul,
.legal ol,
.legal dl,
.legal table,
.legal blockquote,
.legal address {
  margin: 0 0 1rem;
}
.legal ul,
.legal ol {
  padding-left: 1.5rem;
}
.legal li + li {
  margin-top: 0.375rem;
}
.legal li > ul,
.legal li > ol {
  margin: 0.375rem 0 0;
}
.legal dt {
  font-weight: 700;
}
.legal dd {
  margin: 0 0 0.75rem;
}
.legal address {
  font-style: normal;
}
.legal strong {
  font-weight: 700;
}
.legal small,
.legal .updated {
  color: var(--muted);
  font-size: 0.9375rem;
}
.legal blockquote {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--surface);
}
.legal hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--divider);
}
.legal code {
  font-size: 0.9em;
}

/* Wide tables scroll sideways on a phone instead of squeezing the page. */
.legal table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.legal th,
.legal td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  vertical-align: top;
  min-width: 6rem;
}
.legal th {
  font-weight: 700;
  color: var(--heading);
  border-bottom-color: var(--control);
}
.legal caption {
  padding-bottom: 0.5rem;
  text-align: left;
  color: var(--muted);
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .site-footer {
    display: none;
  }
}
