@font-face {
  font-family: 'Syne Variable';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/syne.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Instrument Sans Variable';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/instrument-sans.woff2') format('woff2-variations');
}

:root {
  color-scheme: light;

  /* Light theme: white page, neutral ink */
  --color-paper: #fff;
  --color-paper-raised: oklch(98.5% 0.002 260);
  --color-ink: oklch(21% 0.006 270);
  --color-ink-soft: oklch(45% 0.006 270);
  --color-line: oklch(21% 0.006 270 / 0.12);
  --color-header: rgb(255 255 255 / 0.85);
  /* Cool light grey: the disc behind the hero scene and the contact section */
  --color-disc: oklch(96% 0.003 260);
  --color-tint: oklch(96.5% 0.003 260);
  --grain-opacity: 0;

  /* Sakura for blossoms and washes, beni (seal red) for the single strong accent */
  /* Hero scene: the painted branch and the circuit it turns into */
  --color-tree: var(--color-ink);
  --color-sakura: oklch(87% 0.055 5);
  --color-sakura-deep: oklch(74% 0.105 5);
  --color-beni: oklch(55% 0.17 27);
  --color-gold: oklch(72% 0.1 80);

  /* Syne cuts its descenders (g, j, p, q, y) flat, so it is kept for uppercase text only:
     the wordmark and the labels. Anything in mixed case uses Instrument Sans. */
  --font-display: 'Syne Variable', 'Trebuchet MS', sans-serif;
  --font-body: 'Instrument Sans Variable', system-ui, sans-serif;
  --text-small: 0.8125rem;
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lead: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  --text-title: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --text-section: clamp(2rem, 1.3rem + 3vw, 3.75rem);
  --text-hero: clamp(2.6rem, 1.2rem + 6vw, 6rem);
  --tracking-label: 0.28em;

  --space-gutter: clamp(1.25rem, 0.5rem + 3.5vw, 4rem);
  --space-section: clamp(5rem, 3rem + 9vw, 12rem);
  --space-stack: clamp(1.5rem, 1rem + 2vw, 3rem);
  --content-max: 78rem;

  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 1000ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  /* Set by analytics.js while the cookie notice is showing */
  padding-bottom: var(--cookie-banner-height, 0);
  -webkit-font-smoothing: antialiased;
}

/* Paper grain over the whole page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.18 0 0 0 0 0.17 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

ol,
ul {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

a {
  color: inherit;
}

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

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

::selection {
  background: var(--color-sakura);
}

.container {
  width: min(100% - 2 * var(--space-gutter), var(--content-max));
  margin-inline: auto;
}

.label {
  font-family: var(--font-display);
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  left: var(--space-gutter);
  top: 0.75rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--color-ink);
  color: var(--color-paper);
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
}

/* Button: ink block with a seal-red underline that slides in */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  background: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.button::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--color-beni);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.button:hover {
  transform: translateY(-2px);
}

.button:hover::after,
.button:focus-visible::after {
  transform: scaleX(1);
}

.button:active {
  transform: none;
}

.button__arrow {
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.button:hover .button__arrow {
  transform: translateX(4px);
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.logo__mark {
  width: 2.7rem;
  height: 3.6rem;
}

.logo__text {
  display: grid;
  gap: 0.35rem;
  line-height: 1;
}

.logo__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.32em;
}

.logo__tagline {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-header);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.6rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.75rem);
}

.site-nav__list {
  display: none;
  gap: clamp(1rem, 3vw, 2.75rem);
}

.site-nav__link {
  position: relative;
  padding-block: 0.4rem;
  text-decoration: none;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1.5px;
  background: var(--color-beni);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.site-nav__link:hover::after,
.site-nav__link:focus-visible::after {
  transform: scaleX(1);
}

.site-nav__cta {
  padding: 0.6rem 1.1rem;
  border: 1.5px solid var(--color-ink);
  text-decoration: none;
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.site-nav__cta:hover {
  background: var(--color-ink);
  color: var(--color-paper);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1.5px solid var(--color-line);
  background: none;
  color: inherit;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
}

.theme-toggle:hover {
  border-color: var(--color-ink);
}

.theme-toggle__icon {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

[data-theme='dark'] .theme-toggle__icon {
  transform: rotate(180deg);
}

/* The toggle needs JS; without it the page stays in the light theme */
html:not(.js) .theme-toggle {
  display: none;
}

@media (max-width: 26rem) {
  .logo__tagline {
    display: none;
  }

  .site-nav {
    gap: 0.5rem;
  }

  .logo {
    gap: 0.5rem;
  }

  .logo__name {
    font-size: 1.05rem;
    letter-spacing: 0.24em;
  }

  .site-nav__cta {
    padding-inline: 0.7rem;
    letter-spacing: 0.14em;
  }
}

/* Hero */
.hero {
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 6rem) var(--space-section);
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__label {
  color: var(--color-beni);
}

.hero__heading {
  margin-top: 1.5rem;
  font-size: var(--text-hero);
  line-height: 1.02;
}

.hero__lead {
  max-width: 26rem;
  margin-top: var(--space-stack);
  font-size: var(--text-lead);
  line-height: 1.45;
  color: var(--color-ink-soft);
}

.hero__cta {
  margin-top: var(--space-stack);
}

.hero__visual {
  position: relative;
}

/* Soft sun disc behind the scene */
.hero__visual::before {
  content: '';
  position: absolute;
  inset: 8% 14% 14%;
  border-radius: 50%;
  background: var(--color-disc);
}

.scene {
  position: relative;
  width: 100%;
  overflow: visible;
}

.js .scene {
  opacity: 0;
  transform: translateY(1.5rem);
  animation: rise var(--duration-slow) var(--ease-out-expo) 150ms forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

.scene__branch,
.scene__wire {
  fill: none;
  stroke: var(--color-tree);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene__petal {
  fill: var(--color-sakura);
}

.scene__petal--deep {
  fill: var(--color-sakura-deep);
}

.scene__heart {
  fill: var(--color-beni);
}

/* Watercolor layering: diluted washes under more loaded petals */
.scene__washes {
  opacity: 0.5;
}

.scene__blooms {
  opacity: 0.92;
}

.scene__phone {
  fill: var(--color-paper-raised);
  stroke: var(--color-ink);
  stroke-width: 2.5;
  filter: drop-shadow(0 24px 30px oklch(21% 0.006 270 / 0.16));
}

.scene__screen {
  fill: none;
  stroke: var(--color-line);
  stroke-width: 1;
}

.scene__notch,
.scene__action {
  fill: var(--color-ink);
}

.scene__bar {
  fill: var(--color-line);
}

.scene__node {
  fill: var(--color-paper-raised);
  stroke: var(--color-gold);
  stroke-width: 2;
}

/* Sections: a vertical label on the left, Japanese-book style */
.section {
  padding-block: var(--space-section);
  border-top: 1px solid var(--color-line);
  /* Menu links land just above the heading, not at the top of the section's padding */
  scroll-margin-top: calc(2.5rem - var(--space-section));
}

.section__grid {
  display: grid;
  gap: 2rem;
}

.section__label {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-ink-soft);
}

.section__label::before {
  content: '';
  width: 2.5rem;
  height: 1px;
  background: var(--color-beni);
}

.section__heading {
  max-width: 18ch;
  font-size: var(--text-section);
}

/* A full sentence as a heading: wider measure and a step smaller, so it stays within four lines */
.section__heading--long {
  max-width: 30ch;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
}

/* Journey: one plant growing from seed to blossom along a shared ground line */
.journey__lead {
  margin-top: 1rem;
  font-size: var(--text-lead);
  color: var(--color-ink-soft);
}

.journey {
  display: grid;
  margin-top: clamp(2rem, 4vw, 3.5rem);
}

.journey__step {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  column-gap: 1.25rem;
  align-items: start;
  padding-block: 1.5rem;
  border-top: 1px solid var(--color-line);
}

.journey__art {
  grid-row: span 3;
  width: 100%;
  overflow: visible;
}

.growth__stem {
  fill: none;
  stroke: var(--color-tree);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.growth__seed {
  fill: var(--color-tree);
}

.journey__index {
  color: var(--color-beni);
  letter-spacing: 0.1em;
}

.journey__title {
  font-size: var(--text-title);
}

.journey__summary {
  margin-top: 0.35rem;
  color: var(--color-ink-soft);
}

/* Extras: services outside the journey, on a tinted band that runs edge to edge */
.section--flush {
  padding-bottom: 0;
}

.extras {
  margin-top: clamp(3rem, 6vw, 6rem);
  padding-block: clamp(2.5rem, 5vw, 4rem);
  background: var(--color-tint);
}

.extras__list {
  display: grid;
  gap: 1.5rem;
  text-align: center;
}

/* Keep the text level with the middle of the vertical label */
.extras .section__grid {
  align-items: center;
}

.extras .section__label {
  align-self: center;
}

/* Same hand-drawn blossom as the hero and the journey */
.extras__bloom {
  display: inline-block;
  width: 1.5em;
  margin-right: 0.45em;
  vertical-align: -0.4em;
  overflow: visible;
}

.extras .fact__caption {
  margin-top: 0.35rem;
}

/* About */
.about__text {
  max-width: 34rem;
  margin-top: var(--space-stack);
  font-size: var(--text-lead);
  line-height: 1.5;
  color: var(--color-ink-soft);
}

.about__facts {
  display: grid;
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--color-line);
}

.fact__value {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-title);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.fact__caption {
  color: var(--color-ink-soft);
}

.about__facts--pair .fact__caption {
  max-width: 30rem;
  margin-top: 0.5rem;
}

/* Work */
.work__card {
  display: grid;
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.work__frame {
  display: block;
  border: 1px solid var(--color-ink);
  background: var(--color-paper-raised);
  box-shadow: 0 2rem 4rem -2rem oklch(21% 0.006 270 / 0.3);
  overflow: hidden;
}

.work__chrome {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--color-line);
}

.work__chrome span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-line);
}

.work__chrome span:first-child {
  background: var(--color-sakura-deep);
}

.work__image {
  width: 100%;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}

.work__frame:hover .work__image {
  transform: scale(1.02);
}

.work__kind {
  color: var(--color-beni);
}

.work__name {
  margin-top: 0.5rem;
  font-size: var(--text-title);
}

.work__summary {
  margin-top: 0.75rem;
  color: var(--color-ink-soft);
}

/* What we did, as a plain checklist */
.work__list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.work__list li {
  position: relative;
  padding-left: 1.6rem;
}

.work__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-beni);
  font-weight: 600;
}

.work__invite {
  margin-top: 1.5rem;
}

.work__link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--color-beni);
}

/* Contact */
.contact {
  background: var(--color-tint);
  text-align: center;
}

.contact__mark {
  width: clamp(9rem, 6rem + 12vw, 14rem);
  margin: 0 auto 2.5rem;
}

.contact__heading {
  max-width: none;
  font-size: var(--text-section);
}

.contact__text {
  margin-top: 1rem;
  font-size: var(--text-lead);
  color: var(--color-ink-soft);
}

.contact__email {
  margin-top: var(--space-stack);
  font-size: clamp(0.8rem, 0.5rem + 1.5vw, 1.15rem);
  letter-spacing: 0.02em;
}

.contact__note {
  max-width: 30rem;
  margin: 1.5rem auto 0;
  color: var(--color-ink-soft);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding-block: 2rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__legal {
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer__link,
.legal__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink-soft);
  font: inherit;
  font-size: var(--text-small);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.site-footer__link:hover,
.legal__link:hover {
  color: var(--color-ink);
}

/* Cookie notice. On the site it is a modal <dialog>: a card in the middle of the screen,
   with the page dimmed behind it until the visitor chooses. Both choices look the same. */
.cookie-banner {
  position: fixed;
  z-index: 60;
  width: min(100% - 2rem, 34rem);
  max-width: none;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 0;
  background: var(--color-ink);
  color: var(--color-paper);
  box-shadow: 0 2rem 5rem -1rem oklch(21% 0.006 270 / 0.6);
}

.cookie-banner[open] {
  display: grid;
  gap: 1.25rem;
}

.cookie-banner::backdrop {
  background: oklch(21% 0.006 270 / 0.6);
}

.cookie-banner__title {
  color: var(--color-gold);
}

.cookie-banner__text {
  font-size: var(--text-lead);
  line-height: 1.4;
}

.cookie-banner__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.cookie-banner__button {
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--color-paper);
  background: none;
  color: inherit;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.cookie-banner__button:hover,
.cookie-banner__button:focus-visible {
  background: var(--color-paper);
  color: var(--color-ink);
}

/* On the legal page it does not block: a band along the bottom while the text is read */
.cookie-banner:not(:modal) {
  inset: auto 0 0;
  width: 100%;
  margin: 0;
  padding: 1.25rem var(--space-gutter);
  box-shadow: none;
}

.cookie-banner:not(:modal) .cookie-banner__text {
  max-width: 44rem;
  font-size: inherit;
}

.cookie-banner:not(:modal) .cookie-banner__actions {
  max-width: 22rem;
}

/* Legal page: plain reading column */
.legal {
  max-width: 44rem;
  padding-block: clamp(3rem, 6vw, 6rem) var(--space-section);
}

.legal__title {
  font-size: var(--text-section);
}

.legal__updated {
  margin-top: 0.75rem;
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

.legal section {
  margin-top: 3rem;
}

.legal h2 {
  font-size: var(--text-title);
}

.legal p,
.legal ul {
  margin-top: 1rem;
}

.legal ul {
  display: grid;
  gap: 1rem;
}

.legal__link {
  font-size: inherit;
  color: inherit;
}

/* Scroll reveal: only hides content when JS is running */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

  .about__facts--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem 3rem;
  }
}

@media (min-width: 60rem) {
  .site-nav__list {
    display: flex;
  }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }

  .section__grid {
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
  }

  .section__label {
    align-self: start;
    writing-mode: vertical-rl;
  }

  .section__label::before {
    width: 1px;
    height: 2.5rem;
  }

  /* Side by side: the ground becomes one continuous line under all five stages */
  .journey {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .journey__step {
    display: block;
    padding: 0 1.5rem 0 0;
    border-top: 0;
  }

  .journey__art {
    width: 6.5rem;
    margin-bottom: 1.25rem;
  }

  .journey__step::before {
    content: '';
    display: block;
    height: 1.5px;
    margin: 5.85rem -1.5rem 0 0;
    background: var(--color-gold);
  }

  .journey__art {
    margin-top: -5.95rem;
  }

  .work__card {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
  }
}

/* Dark theme: night background, mint hero branch and circuit, gold accents.
   main.js sets data-theme from the saved choice or the system setting. */
[data-theme='dark'] {
  color-scheme: dark;
  --color-paper: #0b1418;
  --color-paper-raised: #111e24;
  --color-ink: #eef3ef;
  --color-ink-soft: #a9b8b4;
  --color-line: rgb(238 243 239 / 0.16);
  --color-header: rgb(11 20 24 / 0.85);
  --color-disc: #10222a;
  --color-tint: #10222a;
  --color-beni: #c9a24e;
  --color-gold: #c9a24e;
  /* The hero branch and its flowers glow mint on the night background */
  --color-tree: #8ed8b0;
  --color-sakura: #8ed8b0;
  --color-sakura-deep: #5cc596;
  --grain-opacity: 0;
}

[data-theme='dark'] ::selection {
  color: var(--color-paper);
}

[data-theme='dark'] .scene__washes {
  opacity: 0.22;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
