@font-face {
  font-family: "Big Shoulders";
  src: url("fonts/big-shoulders.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
/* Metric-matched stand-ins: while a web font loads, or if it never does, the fitted lines keep their width */
@font-face {
  font-family: "Big Shoulders Fallback";
  src: local("Arial");
  size-adjust: 73.2%;  /* "info@thobey.se": 5.04em in Big Shoulders 400, 6.89em in Arial */
}
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Arial");
  size-adjust: 104.1%; /* "THOBEY SOLUTIONS": 10.56em in Montserrat 500, 10.15em in Arial (tracking excluded) */
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  /* Taken from the logo: slate ink, coral and peach dots */
  --bg: #262936;
  --surface: #313544;
  --ink: #f4f5f8;
  --muted: #b3b5c2;
  --accent: #df5c65;
  --accent-ink: #1d1f29;
  --peach: #e8ab92;
  --field: var(--peach);
  --field-ink: #262936;
  --paper: #f4f5f8;
  --paper-soft: #3d4050;

  --display: "Big Shoulders", "Big Shoulders Fallback", "Arial Narrow", sans-serif;
  --text: "Public Sans", "Segoe UI", system-ui, sans-serif;

  /* Five steps */
  --step-small: 0.875rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.75rem, 1.6rem + 4vw, 5rem);
  --logo: "Montserrat", "Montserrat Fallback", "Segoe UI", system-ui, sans-serif;
  --fit-name: 12.48;   /* "THOBEY SOLUTIONS" is about 12.48em wide in Montserrat 500 with 0.12em tracking */
  --step-display: calc((100cqi - 2 * var(--margin)) / var(--fit-name));

  --margin: max(clamp(1rem, 2.2vw, 2rem), (100vw - 90rem) / 2);
  --gap: clamp(1.25rem, 2vw, 2rem);
  --section: clamp(6rem, 11vw, 9.5rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-reveal: 800ms;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 var(--step-body)/1.55 var(--text);
  font-variant-numeric: lining-nums;
}
::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 0.06em; transition: text-decoration-color var(--t-hover) ease; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-head);
  line-height: 0.9;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}
h3 { font-size: var(--step-lead); line-height: 1.2; font-weight: 600; }
p { text-wrap: pretty; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; background: var(--ink); color: var(--bg); padding: 0.5rem 1rem; }
.skip:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.page { position: relative; z-index: 1; background: var(--bg); overflow-x: clip; }
.hero, .section, .site-footer { container-type: inline-size; }

/* Hero: the name as a monument across the top, the introduction below it */
.hero {
  display: grid;
  grid-template-rows: auto auto auto;
  background: var(--bg);
  overflow: hidden;
}
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem var(--margin);
  font-size: var(--step-small);
}
.brand { display: block; line-height: 0; }
.brand .logo { display: block; height: clamp(2.25rem, 3.2vw, 2.75rem); width: auto; }
.site-nav ul { display: flex; align-items: center; gap: 0 1.75rem; list-style: none; padding: 0; }
.site-nav a { text-decoration: none; color: var(--muted); padding: 0.5rem 0; transition: color var(--t-hover) ease; }
.site-nav a:hover { color: var(--ink); }
.site-nav .lang a { color: var(--ink); font-weight: 600; }
.site-nav .button, .site-nav .button:hover { color: var(--accent-ink); }
.site-nav .button { padding: 0.75rem 1.25rem; }

.hero-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
  grid-row: 3;
  padding: clamp(2.5rem, 5vw, 4.5rem) var(--margin) 0; /* the services section's own top padding is the gap below */
}
.hero-text { grid-column: 1 / span 8; padding-bottom: 0.25rem; }
.hero-role { font-size: clamp(1.5rem, 1rem + 1.4vw, 2.25rem); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; max-width: 30ch; }
.hero-lead { margin-top: 1.25rem; max-width: 40ch; font-size: var(--step-lead); line-height: 1.4; color: var(--muted); }
.hero-facts { margin-top: 1.5rem; font-size: var(--step-small); font-weight: 600; line-height: 1.5; letter-spacing: 0.01em; }
.portrait { grid-column: 9 / span 4; justify-self: start; width: clamp(10rem, 19vw, 18rem); overflow: hidden; border-radius: 50%; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }

/* Set in the logo's lettering: wide geometric capitals, the second word in the logo's peach */
.monument {
  font-family: var(--logo);
  font-weight: 500;
  font-size: var(--step-display);
  line-height: 0.8;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0 var(--margin);
  padding-bottom: 0.13em;
  font-kerning: normal;
  grid-row: 2;
  margin-top: clamp(2.5rem, 6vw, 5.5rem);
}
.monument span { display: inline-block; }
.monument span:last-child { color: var(--peach); margin-right: -0.12em; }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 1rem 1.75rem;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.button:hover { background: #ea7880; }
.button:active { transform: scale(0.97); }

/* Sections share one twelve-column grid and one pair of margins */
.section {
  position: relative;
  padding: var(--section) var(--margin);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.intro { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; }
.intro > * { text-box: trim-start cap alphabetic; }
.intro h2 { grid-column: 1 / span 7; }
.intro p { grid-column: 9 / span 4; max-width: 34ch; }

/* What I do: heading and note across the top, the two offers side by side below */
.services { background: var(--bg); align-items: start; }
.offers { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: 4rem; margin-top: clamp(3.5rem, 7vw, 6rem); }
.offer { grid-column: span 6; padding-right: clamp(0rem, 3vw, 3rem); }
.offer h3 { margin-bottom: 1.25rem; max-width: 18ch; }
.offer p { max-width: 54ch; }
.offer ul { list-style: none; padding: 0; margin-top: 2rem; }
.offer li { padding: 0.375rem 0 0.375rem 1.25rem; position: relative; }
.offer li::before { content: ""; position: absolute; left: 0; top: 0.95em; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: var(--accent); }

/* Selected work: a row of figures, then the client names as one statement */
.work { background: var(--field); color: var(--field-ink); }
.work ::selection { background: var(--field-ink); color: var(--peach); }
.facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  list-style: none;
  padding: 0;
  margin-top: clamp(4rem, 8vw, 7.5rem);
  row-gap: 3.5rem;
}
.facts li { grid-column: span 4; padding-right: 1.5rem; }
.figure {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-head);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.unit { color: var(--paper-soft); font-size: var(--step-body); font-weight: 600; margin: 0.5rem 0 1.25rem; }
.facts h3 { font-size: var(--step-body); margin-bottom: 0.5rem; }
.facts p:last-child { max-width: 40ch; }
.clients {
  grid-column: 1 / span 11;
  margin-top: clamp(5rem, 10vw, 8.5rem);
  font-size: var(--step-lead);
  line-height: 1.4;
  color: #4a3d3f;
  max-width: 62ch;
}
.clients strong { color: var(--field-ink); font-weight: 600; }

/* About: side facts at the left, the paragraph wide from the 34% line */
.about { background: var(--bg); align-items: start; }
.about h2 { grid-column: 1 / -1; margin-bottom: clamp(3rem, 6vw, 5rem); }
.side-facts { grid-column: 1 / span 4; display: grid; gap: 1.5rem; max-width: 22rem; }
.side-facts dt { color: var(--muted); font-size: var(--step-small); }
.side-facts dd { margin-top: 0.125rem; }
.about-text { grid-column: 5 / span 8; font-size: var(--step-lead); line-height: 1.4; }
.about-text p + p { margin-top: 1.25em; }
.about-text p { max-width: 44ch; }

/* Contact: the inverse field, the address as display type */
.contact {
  background: var(--paper);
  color: var(--bg);
  grid-template-rows: auto 1fr auto auto;
}
.contact-top { grid-column: 1 / span 7; }
.contact-top h2 { margin-bottom: 1.5rem; }
.contact-top > p { font-size: var(--step-lead); line-height: 1.35; max-width: 34ch; }
.topics { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 2.25rem; }
.topics[hidden] { display: none; }
.topic {
  font: 600 var(--step-small)/1 var(--text);
  color: var(--bg);
  background: transparent;
  border: 1px solid var(--paper-soft);
  padding: calc(0.875rem - 1px) calc(1.125rem - 1px);
  min-height: 44px;
  cursor: pointer;
  transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.topic:hover { background: #e4e6ee; }
.topic:active { transform: scale(0.96); }
.topic::before { content: "+"; display: inline-block; width: 1em; font-weight: 600; }
.topic[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.topic[aria-pressed="true"]::before { content: "−"; }
.topic-hint { display: block; margin-top: 0.75rem; font-size: var(--step-body); color: var(--paper-soft); }
.topic-hint[hidden] { display: none; }
.contact-top > .subject { margin-top: 1rem; font-size: var(--step-small); color: var(--paper-soft); }
.subject span { font-weight: 600; color: var(--bg); }
.email {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(100cqi / 5.1);
  line-height: 0.82;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  margin-top: clamp(4rem, 9vw, 8rem);
  padding-bottom: 0.16em; /* room for the descenders of @ and y above the contact list */
}
.email span { display: inline-block; transition: transform var(--t-hover) var(--ease-out); }
.email:hover span:last-child { transform: translateX(0.04em); }
.email:hover { color: #b8434c; }
.contact-list {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  list-style: none;
  padding: 0;
  margin-top: 2rem;
  font-size: var(--step-body);
}
.copy { font: 600 var(--step-small)/1 var(--text); border: 0; padding: 0.875rem 1.25rem; min-height: 44px; cursor: pointer; }

.site-footer {
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto clamp(3rem, 8vw, 6rem) auto auto;
  padding: 2.5rem var(--margin) 1.25rem;
  font-size: var(--step-small);
}
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.cols p { color: var(--muted); }
.cols p.first { color: var(--ink); font-weight: 600; }
.cols a { color: inherit; }
.wordmark { grid-row: 3; width: min(100%, 48rem); }
.wordmark .logo { display: block; width: 100%; height: auto; }
.legal { grid-row: 4; margin-top: 1.25rem; color: var(--muted); }

/* Motion: everything is visible without script; the hidden start state only applies under html.js */
@media (prefers-reduced-motion: no-preference) {
  .monument span { animation: rise 1100ms var(--ease-out) both; }
  .monument span + span { animation-delay: 140ms; }
  .hero-text > * { animation: lift 800ms var(--ease-out) both; }
  .hero-text > :nth-child(1) { animation-delay: 380ms; }
  .hero-text > :nth-child(2) { animation-delay: 460ms; }
  .hero-text > :nth-child(3) { animation-delay: 540ms; }
  .portrait img { animation: settle 1800ms var(--ease-soft) both 200ms; }
  /* The logo's dots draw the ring in, one after another: in the header on load, in the footer when it arrives */
  .logo circle { transform-box: fill-box; transform-origin: center; }
  .brand .logo circle { animation: dot 600ms var(--ease-out) both; animation-delay: calc(250ms + var(--i) * 55ms); }
  .js .wordmark[data-reveal] > * { opacity: 1; transform: none; }
  .js .wordmark .logo circle { opacity: 0; transform: scale(0.2); }
  .js .wordmark.is-in .logo circle { animation: dot 700ms var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); }
  .brand:hover .logo circle { animation: pulse 900ms var(--ease-out) both; animation-delay: calc(var(--i) * 25ms); }

  .js [data-reveal] > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out);
  }
  .js [data-reveal].is-in > * { opacity: 1; transform: none; }
  .js [data-reveal] > :nth-child(2) { transition-delay: 80ms; }
  .js [data-reveal] > :nth-child(3) { transition-delay: 160ms; }
  .js [data-reveal] > :nth-child(4) { transition-delay: 240ms; }
  .js [data-reveal] > :nth-child(n+5) { transition-delay: 320ms; }
  .js .facts li:nth-child(2) > * { transition-delay: 90ms; }
  .js .facts li:nth-child(3) > * { transition-delay: 180ms; }
  .js .clients[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out); }
  .js .clients[data-reveal].is-in { opacity: 1; transform: none; }
  .js .offer li { opacity: 0; transform: translateX(-12px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
  .js .offer.is-in li { opacity: 1; transform: none; }
  .js .offer.is-in li:nth-child(1) { transition-delay: 260ms; }
  .js .offer.is-in li:nth-child(2) { transition-delay: 330ms; }
  .js .offer.is-in li:nth-child(3) { transition-delay: 400ms; }
  .js .offer.is-in li:nth-child(4) { transition-delay: 470ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(0.35em); } to { opacity: 1; transform: none; } }
@keyframes lift { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes dot { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: none; } 40% { transform: scale(1.6); } }
@keyframes settle { from { transform: scale(1.08); } to { transform: none; } }

/* Phone: its own composition */
@media (max-width: 47.5em) {
  .site-nav .optional { display: none; }
  .site-nav ul { gap: 0 1rem; }
  .site-nav .button { padding: 0.75rem 1rem; }
  .hero { position: relative; }
  .hero-body { grid-row: 3; align-content: start; grid-template-columns: 1fr; row-gap: 1.75rem; padding-top: 1.75rem; padding-bottom: 0; }
  .hero-text, .portrait { grid-column: 1; }
  .portrait { grid-row: 1; width: 9.5rem; justify-self: center; }
  .monument { grid-row: 2; margin: 1.5rem 0 0; }
  .section { grid-template-columns: 1fr; }
  #services { padding-top: 3.5rem; }
  .intro, .offers, .facts { grid-template-columns: 1fr; }
  .intro h2, .intro p, .offer, .offers, .facts li, .clients, .side-facts, .about-text, .contact-top { grid-column: 1; }
  .intro p { margin-top: 1.25rem; }
  .offer { padding-right: 0; }
  .side-facts { grid-template-columns: 1fr 1fr; gap: 1.25rem; max-width: none; margin-bottom: 3rem; }
  .side-facts > div:first-child { grid-column: 1 / -1; }
  .contact-list { flex-direction: column; align-items: flex-start; gap: 0.75rem; font-size: 0.9375rem; }
  .cols { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .cols > :first-child { grid-column: 1 / -1; } /* company on its own row, Contact and Elsewhere side by side */
}

/* Aurora behind the hero and, fainter, the contact section (tools/shaders). Fades in once the first frame is drawn; without WebGPU the plain background stays. */
.hero, .contact { position: relative; isolation: isolate; }
/* Still frames of the same auroras, for browsers where WebGPU can't run. The live canvas fades in over them. */
.hero { background-image: url("aurora-hero.webp"); background-position: center top; background-size: max(100%, 64rem) auto; background-repeat: no-repeat; }
.contact { background-image: url("aurora-contact.webp"); background-position: center top; background-size: max(100%, 64rem) auto; background-repeat: no-repeat; }
.section-shader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0; transition: opacity 1.2s var(--ease-soft); pointer-events: none; }
.hero > .section-shader { -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.contact > .section-shader { -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 70%); mask-image: linear-gradient(to bottom, #000 20%, transparent 70%); }
.section-shader.is-inverted { filter: invert(1); }
.section-shader.is-on { opacity: 1; }
