/* ==========================================================================
   Transleya — main stylesheet
   Mobile first: base styles target small screens, media queries scale up.
   Breakpoints: 48em (768px) tablet, 64em (1024px) desktop.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (self-hosted Manrope variable, SIL OFL — see assets/fonts/OFL.txt)
   -------------------------------------------------------------------------- */

/* Latin: covers German (ä ö ü ß), Spanish (á é í ñ ó ú ¿ ¡) and à */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  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;
}

/* Latin Extended: covers Bosnian/Croatian/Serbian (č ć đ š ž) */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2");
  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;
}

/* --------------------------------------------------------------------------
   2. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Colour — sampled from the mockup */
  --color-bg: #ede9e7;   /* warm light beige */
  --color-rust: #b44715; /* text, headings, borders */

  /* Type */
  --font-sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-bold: 700;

  /* Type scale (mobile values; larger screens override below) */
  --fs-small: 0.875rem;  /* 14px */
  --fs-body: 1rem;       /* 16px */
  --fs-list-lg: 1.25rem; /* 20px  — large bullet list */
  --fs-h4: 1.25rem;      /* 20px  — card titles */
  --fs-h3: 1.625rem;     /* 26px  — small section heading, hero subtitle */
  --fs-h2: 2rem;         /* 32px  — section headings */
  --fs-h1: 2.75rem;      /* 44px  — name */
  --fs-subtitle: 1.375rem; /* 22px — hero subtitle */
  --fs-cta: 2rem;        /* 32px  — call to action */
  --fs-callout: 1.125rem; /* 18px — bold one-liner */

  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-body: 1.7;

  --tracking-display: -0.03em; /* tight tracking on the large light headings */
  --tracking-title: -0.02em;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;  /*  4px */
  --space-2: 0.5rem;   /*  8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 2.75rem;  /* 44px */
  --space-8: 4rem;     /* 64px */
  --space-9: 6rem;     /* 96px */
  --space-10: 8rem;    /* 128px */

  /* Layout */
  --gutter: var(--space-5);       /* side padding of the page */
  --section-gap: var(--space-8);  /* vertical space between sections */
  --max-width: 85.375rem;         /* 1366px, the mockup width */
  --border: 1px solid var(--color-rust);
}

@media (min-width: 48em) {
  :root {
    --fs-body: 1.0625rem;  /* 17px */
    --fs-list-lg: 1.5rem;  /* 24px */
    --fs-h4: 1.75rem;      /* 28px */
    --fs-h3: 2rem;         /* 32px */
    --fs-h2: 3rem;         /* 48px */
    --fs-h1: 3.75rem;      /* 60px */
    --fs-subtitle: 1.75rem; /* 28px */
    --fs-cta: 2.75rem;     /* 44px */
    --fs-callout: 1.25rem; /* 20px */

    --gutter: var(--space-7);
    --section-gap: var(--space-9);
  }
}

@media (min-width: 64em) {
  :root {
    --fs-body: 1.125rem;   /* 18px */
    --fs-list-lg: 2rem;    /* 32px */
    --fs-h4: 2.125rem;     /* 34px */
    --fs-h3: 2.5rem;       /* 40px */
    --fs-h2: 4rem;         /* 64px */
    /* Fluid between 1024px and 1366px so lines fit their columns */
    --fs-h1: clamp(4.5rem, 7vw, 6rem);    /* up to 96px, as in the mockup */
    --fs-subtitle: 2rem;   /* 32px */
    --fs-cta: clamp(3.25rem, 5.3vw, 4.5rem); /* up to 72px */
    --fs-callout: 1.5rem;  /* 24px */

    --gutter: 3.125rem;    /* 50px, as in the mockup */
    --section-gap: var(--space-10);
  }
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-rust);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

p {
  margin: 0 0 var(--space-5);
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background-color: var(--color-rust);
  color: var(--color-bg);
}

/* --------------------------------------------------------------------------
   4. Headings — large and thin, tightly tracked
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--color-rust);
  overflow-wrap: break-word;
}

/* Long German compounds (e.g. "Sprachkombinationen") must not overflow on
   very narrow phones; hyphenation follows the page language (de-CH).
   Only below 480px, so wider screens break lines whole-word like the mockup. */
@media (max-width: 29.99em) {
  h1,
  h2,
  h3,
  h4,
  .cta {
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}

h1,
.h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
}

h2,
.h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
}

h3,
.h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-title);
}

/* Card titles are the one bold heading style in the mockup */
h4,
.h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-title);
}

/* --------------------------------------------------------------------------
   5. Text styles
   -------------------------------------------------------------------------- */

/* Hero subtitle under the name */
.subtitle {
  font-size: var(--fs-subtitle);
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-title);
}

/* Small body text (hero intro, about, card text) */
.text-small {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* Bold single-line statement (e.g. under the price cards) */
.callout {
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
}

/* Comfortable reading width for running text */
.measure {
  max-width: 38em;
}

/* --------------------------------------------------------------------------
   6. Cards — thin rust border, no fill
   -------------------------------------------------------------------------- */

.card {
  border: var(--border);
  padding: var(--space-5) var(--space-4);
}

.card > * + * {
  margin-top: var(--space-4);
}

@media (min-width: 48em) {
  .card {
    padding: var(--space-6);
  }
}

@media (min-width: 64em) {
  .card {
    padding: var(--space-7);
  }

  .card > * + * {
    margin-top: var(--space-5);
  }
}

/* --------------------------------------------------------------------------
   7. Bullet lists — small round rust dots
   -------------------------------------------------------------------------- */

.list {
  margin: 0;
  padding-left: 1.25em;
  list-style: disc;
}

.list li::marker {
  color: var(--color-rust);
  font-size: 0.85em;
}

.list li + li {
  margin-top: var(--space-1);
}

/* Large list (e.g. specialist areas) */
.list--large {
  font-size: var(--fs-list-lg);
  line-height: var(--lh-snug);
  padding-left: 1.1em;
}

.list--large li + li {
  margin-top: var(--space-3);
}

@media (min-width: 64em) {
  .list--large {
    margin-left: var(--space-6);
  }

  .list--large li + li {
    margin-top: 1.25rem; /* ~62px line pitch, as in the mockup */
  }
}

/* --------------------------------------------------------------------------
   8. Layout helpers
   -------------------------------------------------------------------------- */

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

/* Half the gap above and below, so two sections together give one full gap */
.section {
  padding-block: calc(var(--section-gap) / 2);
}

/* Stack: even vertical rhythm between direct children */
.stack > * + * {
  margin-top: var(--space-5);
}

/* Two columns from tablet up, single column on mobile */
.grid-2 {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 48em) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
  }
}

@media (min-width: 64em) {
  .grid-2 {
    gap: var(--space-9);
  }
}

/* Visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   9. Page sections
   -------------------------------------------------------------------------- */

.section__title {
  margin-bottom: var(--space-6);
}

@media (min-width: 64em) {
  .section__title {
    margin-bottom: var(--space-8);
  }
}

/* Hero: centred text, portrait beside it from tablet up */
.hero__grid {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

.hero__text {
  text-align: center;
}

.hero__subtitle {
  margin-top: var(--space-4);
}

.hero__intro {
  max-width: 30em;
  margin: var(--space-6) auto 0;
}

.hero__photo {
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 27rem; /* 432px, as in the mockup */
}

.hero__photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

@media (min-width: 48em) {
  .hero__grid {
    grid-template-columns: 1.4fr 1fr;
    gap: var(--space-8);
  }

  .hero__subtitle {
    margin-top: var(--space-6);
  }

  .hero__intro {
    margin-top: var(--space-8);
  }
}

/* Desktop: the hero fills one 768px "slide" like the mockup, content centred */
@media (min-width: 64em) {
  .hero {
    display: flex;
    align-items: center;
    min-height: 48rem;
  }

  .hero__photo {
    justify-self: start;
  }
}

/* Call to action + about */
.intro {
  align-items: start;
}

.cta {
  margin: 0;
  font-size: var(--fs-cta);
  line-height: 1.05;
  overflow-wrap: break-word;
}

.cta a {
  text-decoration: none;
}

.cta a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.about h2 {
  margin-bottom: var(--space-3);
}

@media (min-width: 64em) {
  .about {
    padding-top: var(--space-8);
  }
}

/* Language pairs: cards stacked in the left half (as in the mockup);
   the right half is reserved for the laptop photo once it is added */
.langs__cards {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 64em) {
  .langs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-9);
    align-items: center;
  }

  .langs__cards {
    gap: var(--space-8);
  }
}

/* Prices */
.prices__note {
  margin-top: var(--space-6);
}

/* Contact */
.contact__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact__list li + li {
  margin-top: var(--space-2);
}

/* E-mail spam decoy: hidden from view, copy/paste and screen readers */
.email__decoy {
  display: none;
}

/* Sections focused by the smooth-scroll script need no focus ring */
[tabindex="-1"]:focus {
  outline: none;
}

/* Fade-in on scroll. The .reveal class is only ever added by js/main.js,
   so without JavaScript every section is simply visible. */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media print {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   10. Motion
   -------------------------------------------------------------------------- */

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