/*
 * The Idiomatic Labs website. Plain CSS, no build step.
 *
 * Two layers of colour:
 * - the company's: neutral paper and ink with one accent, a deeper version of the logo's blue;
 * - each product's: product sections read --product-* tokens, which default to the company's
 *   palette. A product sets its own values on its class (.expat below), so its colours stay
 *   inside its own sections and a new product needs one block of tokens, not new rules.
 * Faces: Figtree (text) and Newsreader (headings), served from /fonts with their licences.
 */

@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree-Variable.subset.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/Newsreader-Variable.subset.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --sunken: #edede8;
  --ink: #121418;
  --muted: #545a63;
  --line: #dcddd7;
  --line-strong: #c4c6bf;
  --accent: #1f4ea3;
  --accent-strong: #173d82;
  --on-accent: #ffffff;
  --focus: #1f4ea3;

  /* Product roles; the defaults keep a product section readable before it has its own palette. */
  --product-bg: var(--sunken);
  --product-surface: var(--surface);
  --product-ink: var(--ink);
  --product-muted: var(--muted);
  --product-line: var(--line);
  --product-accent: var(--accent);
  --product-accent-strong: var(--accent-strong);
  --product-on-accent: var(--on-accent);
  --product-mark: var(--accent);
  --product-mark-fg: var(--accent-strong);
  --product-mark-bg: var(--surface);

  --font-text: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4rem, 9vw, 7rem);
  --measure: 38rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --surface: #15181c;
    --sunken: #1b1f24;
    --ink: #ecebe6;
    --muted: #a3a8b0;
    --line: #2a2e34;
    --line-strong: #3a3f46;
    --accent: #8eb0f2;
    --accent-strong: #b3c9f7;
    --on-accent: #0e1013;
    --focus: #8eb0f2;
    color-scheme: dark;
  }
}

/* The Expat - Portuguese: the app's own tokens (src/app/globals.css). */

.expat {
  --product-bg: #f6f1e7;
  --product-surface: #fbf8f2;
  --product-ink: #1e1c19;
  --product-muted: #625c53;
  --product-line: #e2d9c9;
  --product-accent: #0f5c3f;
  --product-accent-strong: #0b4a32;
  --product-on-accent: #fbf8f2;
  --product-mark: #a87b22;
  --product-mark-fg: #6f500f;
  --product-mark-bg: #f3e6c4;
}

@media (prefers-color-scheme: dark) {
  .expat {
    --product-bg: #141210;
    --product-surface: #1e1b18;
    --product-ink: #f1eadc;
    --product-muted: #b2a898;
    --product-line: #37312a;
    --product-accent: #6dbf97;
    --product-accent-strong: #86cfab;
    --product-on-accent: #0e1a14;
    --product-mark: #d4ae5c;
    --product-mark-fg: #e2c27a;
    --product-mark-bg: #332a17;
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
  /* With very large text on a narrow screen a long word breaks instead of widening the page. */
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
}

h3 {
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

p,
li,
dd {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -5rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.skip:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-label {
  font-family: var(--font-text);
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.muted {
  color: var(--muted);
}

.lead {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: var(--measure);
}

/* Rows start at the top, so a heading stays with its paragraph when a column beside it is taller. */
.prose {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 1.1rem;
  max-width: var(--measure);
}

.prose a {
  overflow-wrap: anywhere;
}

/* A name kept on one line wherever a line is wide enough for it; on the narrowest screens it may wrap. */
@media (min-width: 22rem) {
  .keep {
    white-space: nowrap;
  }
}

/* At heading sizes the name needs a wider screen. */
@media (min-width: 40rem) {
  .keep-large {
    white-space: nowrap;
  }
}

/* Header and navigation: no script; the links wrap under the name on a narrow screen. */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: auto;
  height: 28px;
}

.wordmark {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5em;
}

@media (max-width: 40rem) {
  .site-header .container {
    padding-block: 0.75rem 0.25rem;
  }

  .wordmark {
    font-size: 0.8125rem;
    letter-spacing: 0.13em;
    white-space: normal;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav ul {
    gap: 0 1.5rem;
  }
}

/* Buttons and links */

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.button-secondary {
  border-color: var(--muted);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}

/* The arrow is decoration: the second value gives it empty alternative text where supported. */
.text-link::after {
  content: "\2192";
  content: "\2192" / "";
}

.text-link:hover {
  text-decoration: underline;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.inline-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Sections */

.section {
  padding-block: var(--section);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 1rem;
  max-width: 44rem;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

/* Home: hero */

.hero {
  padding-block: clamp(4rem, 10vw, 8rem) 0;
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.hero h1 {
  max-width: 20ch;
}

.hero .actions {
  margin-top: 0.75rem;
}

.hero-wave {
  width: 100%;
  height: clamp(90px, 14vw, 160px);
  margin-top: clamp(3rem, 7vw, 5rem);
  overflow: visible;
}

.hero-wave path {
  fill: none;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.wave-ink {
  stroke: var(--ink);
  opacity: 0.26;
}

.wave-accent {
  stroke: var(--accent);
  opacity: 0.7;
}

/* The lines draw in once as the page opens; with reduced motion they are simply there. */
@media (prefers-reduced-motion: no-preference) {
  .hero-wave path {
    animation: draw-line 2.2s cubic-bezier(0.33, 0, 0.2, 1) both;
  }

  .wave-accent path {
    animation-delay: 0.25s;
  }
}

@keyframes draw-line {
  from {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }

  to {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
  }
}

/* Feature lists: hairline above each item */

.features {
  display: grid;
  gap: 2rem clamp(1.5rem, 4vw, 3rem);
}

/* Column counts are set per list, so a row never ends with one item on its own. */
.cols-1,
.cols-3,
.cols-4 {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 40rem) {
  .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 56rem) {
  .cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.features > li {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-strong);
}

.features p {
  max-width: 40rem;
  color: var(--muted);
}

/* Product sections: colours come from the product's tokens */

.product {
  background: var(--product-bg);
  color: var(--product-ink);
}

.section.product {
  border-block: 1px solid var(--product-line);
}

.section.product + .section {
  border-top: 0;
}

.section.product + .section.product {
  border-top: 1px solid var(--product-line);
}

.product-page .section.product {
  border-bottom: 0;
}

.product a:not(.button) {
  color: var(--product-accent);
}

.product a:not(.button):hover {
  color: var(--product-accent-strong);
}

.product .eyebrow {
  color: var(--product-mark-fg);
}

.product .lead,
.product .features p,
.product .muted,
.product .note {
  color: var(--product-muted);
}

.product .features > li {
  border-top-color: var(--product-line);
}

.product .features > li::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  margin-top: -1.3rem;
  margin-bottom: 1.1rem;
  background: var(--product-accent);
}

.product .button-primary {
  background: var(--product-accent);
  color: var(--product-on-accent);
}

.product .button-primary:hover {
  background: var(--product-accent-strong);
}

.product .button-secondary {
  border-color: var(--product-muted);
  color: var(--product-ink);
}

.product .button-secondary:hover {
  border-color: var(--product-ink);
}

.product :focus-visible {
  outline-color: var(--product-accent);
}

.product-intro {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 56rem) {
  .product-intro {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}

.product-id {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.app-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 8px 24px rgb(0 0 0 / 0.08);
}

.lockup {
  display: grid;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-weight: 450;
  line-height: 1;
}

.lockup-name {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  letter-spacing: -0.015em;
}

.lockup-language {
  font-family: var(--font-text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--product-accent);
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  line-height: 1.25;
  color: var(--product-ink);
}

.status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-self: start;
  gap: 0.35rem 0.6rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--product-mark-bg);
  color: var(--product-mark-fg);
  font-size: 0.875rem;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--product-mark);
}

.product-body {
  display: grid;
  gap: 2rem;
}

.product-body .lead + .muted {
  margin-top: -0.75rem;
}

/* Product list (About): one card per product, each in its own palette */

.product-list {
  display: grid;
  gap: 1rem;
}

.product-card {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--product-line);
  border-radius: 16px;
}

@media (min-width: 48rem) {
  .product-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 2rem;
  }
}

.product-card-body {
  display: grid;
  gap: 0.9rem;
  justify-items: start;
}

.product-card .lockup-name {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.product-card p:not(.status) {
  color: var(--product-muted);
}

/* Our approach */

.approach-quote {
  max-width: 50rem;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
  padding-left: clamp(1.25rem, 3vw, 2rem);
  border-left: 2px solid var(--accent);
}

.approach-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* About and company facts */

.split {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}

.facts {
  display: grid;
  gap: 0;
  align-content: start;
  border-top: 1px solid var(--line-strong);
}

.facts > div {
  display: grid;
  gap: 0.15rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

address {
  font-style: normal;
}

/* Contact */

.contact-list {
  display: grid;
  gap: 1rem;
}

.contact-list > li {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.contact-list p {
  color: var(--muted);
}

.contact-list a {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Page heads (inner pages) */

.page-head {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 3.5rem);
}

.page-head .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.page-head + .section {
  padding-top: clamp(1rem, 3vw, 2rem);
}

.page-head h1 {
  max-width: 18ch;
}

/* Product page: the course plan */

.course-plan {
  display: grid;
  gap: 1rem;
}

.course-plan > li {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  padding: 1.4rem 1.5rem;
  background: var(--product-surface);
  border: 1px solid var(--product-line);
  border-radius: 12px;
}

.course-plan ul {
  display: grid;
  gap: 0.3rem;
  color: var(--product-muted);
  font-size: 0.975rem;
}

/* Product page: screens from the app, shown at half their pixel size */

.screens {
  display: grid;
  gap: 2.5rem clamp(2rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 300px);
}

@media (min-width: 40rem) {
  .screens {
    grid-template-columns: repeat(2, minmax(0, 300px));
  }
}

.screens figure {
  display: grid;
  gap: 1rem;
  max-width: 300px;
}

.screens img {
  width: 100%;
  height: auto;
  border: 1px solid var(--product-line);
  border-radius: 28px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 12px 32px rgb(0 0 0 / 0.08);
}

.screens figcaption {
  color: var(--product-muted);
  font-size: 0.975rem;
}

.screens figcaption strong {
  color: var(--product-ink);
  font-weight: 650;
}

.note {
  margin-top: 2rem;
  max-width: var(--measure);
  font-size: 0.95rem;
  color: var(--muted);
}

/* Footer: the name above three link columns on a tablet, beside them from 64rem. */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: auto;
  }
}

.footer-brand {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.footer-brand p {
  color: var(--muted);
  max-width: 22rem;
}

.footer-col {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.footer-col h2 {
  font-family: var(--font-text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
