/* ==========================================================================
   sunny side studio by Sonja Ritter
   Farben, Schrift und Abstände sind als Variablen in :root definiert.
   ========================================================================== */

/* ---------- Schriften (selbst gehostet, keine externen Anfragen) ---------- */
@font-face {
  font-family: "Gloock";
  src: url("../fonts/gloock-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
/* Fallbacks mit angeglichenen Metriken: verhindert Layout-Sprünge beim Nachladen */
@font-face {
  font-family: "Gloock Fallback";
  src: local("Times New Roman"), local("Liberation Serif"), local("Times");
  size-adjust: 116.9%;
  ascent-override: 83.4%;
  descent-override: 19.25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 114.26%;
  ascent-override: 84.72%;
  descent-override: 21.97%;
  line-gap-override: 0%;
}

/* ---------- Design-Tokens ---------- */
:root {
  /* Markenfarben aus dem Briefing */
  --vanille: #ffe7c2;
  --orange: #ff751f;
  --pfirsich: #ffbd59;
  --tuerkis: #5ce1e6;
  /* Ergänzungen: Textfarbe und helle Fläche */
  --espresso: #3a1c0b;
  --espresso-soft: #5e3d29;
  --creme: #fff6e8;
  --line: rgb(58 28 11 / 0.14);

  --font-display: "Gloock", "Gloock Fallback", Georgia, serif;
  --font-text: "Montserrat", "Montserrat Fallback", system-ui, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --wrap: 72rem;
  --section: clamp(4.5rem, 10vw, 8.5rem);
  --header-h: 4.5rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

/* ---------- Basis ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: var(--vanille);
  color: var(--espresso);
  font: 400 1.0625rem/1.65 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
p {
  margin: 0;
  text-wrap: pretty;
}
a {
  color: inherit;
}
main {
  flex: 1;
}
img,
svg {
  max-width: 100%;
}
svg {
  fill: currentColor;
}
::selection {
  background: var(--pfirsich);
  color: var(--espresso);
}
:focus-visible {
  outline: 3px solid var(--espresso);
  outline-offset: 3px;
  border-radius: 4px;
}
[hidden] {
  display: none !important;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--espresso);
  color: var(--vanille);
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip:focus {
  top: 0.75rem;
}

/* Kleine Sonne als Inline-Icon (ersetzt das Emoji, sieht überall gleich aus) */
.sun-icon {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  vertical-align: -0.08em;
  fill: none;
  stroke: currentColor;
}

/* ---------- Buttons und Links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem clamp(1.25rem, 5vw, 1.6rem);
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: var(--espresso);
  font: 600 1rem/1.2 var(--font-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s, transform 0.25s var(--ease);
}
.btn:hover {
  background: var(--pfirsich);
}
.btn:active {
  transform: scale(0.97);
}
.btn .sun-icon {
  width: 1.35rem;
  height: 1.35rem;
  transition: transform 0.9s var(--ease);
}
.btn:hover .sun-icon {
  transform: rotate(90deg);
}
.btn--dark {
  background: var(--espresso);
  color: var(--vanille);
}
.btn--dark:hover {
  background: var(--vanille);
  color: var(--espresso);
}

.link {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--orange);
  transition: text-decoration-color 0.25s;
}
.link:hover {
  text-decoration-color: currentColor;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  background: var(--vanille);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.top-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 8px;
  pointer-events: none;
}
.header.is-scrolled {
  border-bottom-color: var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 100%;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--orange);
  text-decoration: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0s;
}
.brand__sun {
  width: 1.9rem;
  height: 1.9rem;
  fill: none;
  stroke: currentColor;
  transition: transform 0.9s var(--ease);
}
.brand:hover .brand__sun {
  transform: rotate(90deg);
}
.brand__word {
  width: 6.25rem;
  height: auto;
}
/* Startseite: Das Logo steht gross im Hero und wandert erst beim Scrollen in den Header */
.js .header--home:not(.is-past-hero) .brand {
  opacity: 0;
  transform: translateY(-0.4rem);
  visibility: hidden;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s 0.3s;
}

.nav__list {
  display: flex;
  gap: clamp(1.25rem, 2.6vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__link {
  position: relative;
  display: block;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.nav__link::after {
  content: "";
  position: absolute;
  inset: auto 0 0.2rem;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__link:hover::after,
.nav__link[aria-current]::after {
  transform: scaleX(1);
}
.menu-btn {
  display: none;
}

@media (max-width: 47.99rem) {
  .js .menu-btn {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--espresso);
    border-radius: 999px;
    background: none;
    color: var(--espresso);
    font: 600 0.9375rem/1 var(--font-text);
    cursor: pointer;
  }
  .nav {
    display: none;
  }
  .js .nav {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 auto;
    padding: 0.5rem var(--gutter) 2rem;
    background: var(--vanille);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transform: translateY(-0.75rem);
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s 0.25s;
  }
  .js .nav.is-open {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s;
  }
  .nav__list {
    flex-direction: column;
    gap: 0;
  }
  .nav__link {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1.15;
  }
  .nav__link::after {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  --disc: clamp(14.5rem, 68vw, 19rem); /* Durchmesser der Sonnenscheibe */
  position: relative;
  padding-top: var(--header-h);
  overflow: clip;
}
.hero__inner {
  display: grid;
  gap: 2.25rem;
  padding-bottom: clamp(3.5rem, 9vw, 5rem);
}
/* Bühne: Scheibe mit Logo, Strahlen laufen über den Rand hinaus und werden beschnitten */
.hero__stage {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(var(--disc) + 5rem);
  margin-inline: calc(var(--gutter) * -1);
  overflow: clip;
}
/* Ring der Scheibe: reines CSS, bleibt beim Laden sofort stehen */
.hero__stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--disc);
  aspect-ratio: 1;
  margin: calc(var(--disc) * -0.5) 0 0 calc(var(--disc) * -0.5);
  border: calc(var(--disc) * 0.0242) solid var(--orange);
  border-radius: 50%;
}
/* Strahlen: Original-Icon, Scheibe = 36,6 % der Gesamtgrösse */
.sun {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--disc) * 2.7312);
  aspect-ratio: 1;
  margin: calc(var(--disc) * -1.3656) 0 0 calc(var(--disc) * -1.3656);
  color: var(--orange);
  pointer-events: none;
  animation: sun-in 1s var(--ease) both;
}
.sun svg {
  display: block;
  width: 100%;
  height: 100%;
  will-change: transform;
  animation: sun-spin 240s linear infinite;
}
.sun.is-paused svg {
  animation-play-state: paused;
}
/* Nur opacity und transform: läuft auf der GPU, blockiert den Seitenaufbau nicht */
@keyframes sun-in {
  from {
    opacity: 0;
    transform: scale(0.93) rotate(-12deg);
  }
}
@keyframes sun-spin {
  to {
    transform: rotate(360deg);
  }
}
.hero__logo {
  position: relative;
  width: calc(var(--disc) * 0.7);
  margin: 0;
}
.hero__logo svg {
  display: block;
  width: 100%;
  height: auto;
}
.hero__text {
  display: grid;
  gap: 1.75rem;
  justify-items: start;
}
.hero__title {
  font-size: clamp(1.4375rem, 7vw, 2.5rem);
  line-height: 1.1;
}
.nb {
  white-space: nowrap;
}

@media (min-width: 64rem) {
  .hero {
    --disc: clamp(15rem, 22vw, 20rem);
  }
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) var(--disc);
    align-items: center;
    /* Textspalte endet genau ausserhalb des Strahlenkreises */
    column-gap: calc(var(--disc) * 0.8656 + 2.5rem);
    min-height: min(100svh - var(--header-h), 46rem);
    padding-block: 4rem;
  }
  .hero__stage {
    order: 2;
    height: var(--disc);
    margin: 0;
    overflow: visible;
  }
  .hero__text {
    order: 1;
    gap: 2.25rem;
  }
  .hero__title {
    font-size: clamp(2rem, 2.75vw, 2.5rem);
    line-height: 1.12;
    text-wrap: wrap;
  }
}

/* ---------- Abschnitte ---------- */
.section {
  padding-block: var(--section);
}
.section--creme {
  background: var(--creme);
}
.section__title {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  font-size: clamp(2.25rem, 5.4vw, 3.5rem);
}

/* ---------- Leistungen ---------- */
.services {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.service {
  display: grid;
  gap: 0.9rem 2rem;
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--line);
}
.service__sun {
  width: 3rem;
  height: 3rem;
  margin-left: -0.45rem;
  overflow: visible;
}
.service__sun circle {
  fill: currentColor;
}
.service__sun path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.6;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.9s var(--ease);
}
/* Die Strahlen wachsen, sobald die Zeile ins Bild kommt, und drehen beim Hover weiter */
.js .service:not(.is-in) .service__sun path {
  transform: scale(0.35) rotate(-60deg);
}
.service:hover .service__sun path {
  transform: rotate(30deg);
}
.service--orange .service__sun {
  color: var(--orange);
}
.service--pfirsich .service__sun {
  color: var(--pfirsich);
}
.service--tuerkis .service__sun {
  color: var(--tuerkis);
}
.service__title {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.15;
}
.service__text {
  max-width: 36rem;
  color: var(--espresso-soft);
  hyphens: auto;
}
@media (min-width: 48rem) {
  .service {
    grid-template-columns: 3.5rem minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
  }
  .service__title {
    padding-top: 0.35rem;
  }
  .service__text {
    padding-top: 0.6rem;
  }
}

/* ---------- Über ---------- */
.about {
  display: grid;
  gap: clamp(2.25rem, 6vw, 5rem);
  align-items: center;
}
.about__media {
  width: min(100%, 22rem);
  margin: 0 auto;
}
.about__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 999px 999px 1.5rem 1.5rem;
  background: var(--pfirsich);
}
.about__title {
  margin-bottom: 1.5rem;
  font-size: clamp(2.25rem, 5.4vw, 3.5rem);
}
.about__title .sun-icon {
  color: var(--orange);
}
.about__lead {
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.7vw, 1.75rem);
  line-height: 1.25;
  text-wrap: balance;
}
.about__body {
  max-width: 36rem;
  hyphens: auto;
}
.about__body p + p {
  margin-top: 1.1em;
}
@media (min-width: 56rem) {
  .about {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
  .about__media {
    width: min(100%, 24rem);
  }
}

/* ---------- Projekte ---------- */
.case {
  display: grid;
  gap: 1.5rem 4rem;
  padding: clamp(1.75rem, 5vw, 4rem);
  border-radius: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--tuerkis);
}
.case__head {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}
/* Kundenlogo auf eigener heller Kachel, damit es auf Türkis sauber steht */
.case__logo {
  display: block;
  width: 9rem;
  padding: 0.9rem;
  border-radius: 1.25rem;
  background: var(--creme);
}
.case__logo img {
  display: block;
  width: 100%;
  height: auto;
}
.case__title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1;
}
.case__role {
  margin-top: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.case__text {
  max-width: 36rem;
  hyphens: auto;
}
.case__text p + p {
  margin-top: 1.1em;
}
.case__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border: 1.5px solid var(--espresso);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s;
}
.pill:hover {
  background: var(--espresso);
  color: var(--vanille);
}
.pill svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.3s var(--ease);
}
.pill:hover svg {
  transform: translate(2px, -2px);
}
@media (min-width: 56rem) {
  .case {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: end;
  }
  .case__head {
    gap: 2rem;
  }
}

/* ---------- Kontakt ---------- */
.contact {
  background: var(--orange);
}
.contact__title {
  font-size: clamp(2.75rem, 9.5vw, 6.5rem);
  line-height: 0.98;
}
.contact__title .sun-icon {
  width: 0.72em;
  height: 0.72em;
  vertical-align: -0.02em;
  color: var(--vanille);
  transition: transform 1.2s var(--ease);
}
.contact:hover .contact__title .sun-icon {
  transform: rotate(120deg);
}
.contact__grid {
  display: grid;
  gap: 2.5rem 4rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
.contact__text {
  max-width: 32rem;
  font-size: 1.125rem;
}
.contact__text p + p {
  margin-top: 1.1em;
  font-weight: 600;
}
.contact__mail {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5.6vw, 2.5rem);
  line-height: 1.15;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgb(58 28 11 / 0.35);
  transition: text-decoration-color 0.25s;
}
.contact__mail:hover {
  text-decoration-color: currentColor;
}
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.75rem;
}
.copy {
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: inherit;
  font: 600 0.9375rem/1.2 var(--font-text);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
  cursor: pointer;
}
@media (min-width: 56rem) {
  .contact__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
  }
}

/* ---------- Footer ---------- */
.footer {
  padding-block: 2.75rem;
  font-size: 0.9375rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.footer__logo {
  display: block;
  width: 8.5rem;
  height: auto;
}
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  align-items: center;
}
.footer__links {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__links a {
  text-underline-offset: 0.2em;
}

/* ---------- Rechtsseiten und 404 ---------- */
.page {
  padding-block: calc(var(--header-h) + clamp(3rem, 8vw, 5.5rem)) var(--section);
}
.prose {
  max-width: 42rem;
}
.prose h1 {
  margin-bottom: 2rem;
  font-size: clamp(2.5rem, 7vw, 4rem);
}
.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.5rem;
  line-height: 1.2;
}
.prose p + p,
.prose ul + p,
.prose p + ul {
  margin-top: 1em;
}
.prose ul {
  margin: 0;
  padding-left: 1.2rem;
}
.prose li + li {
  margin-top: 0.35em;
}
.prose address {
  font-style: normal;
}
.prose address + p {
  margin-top: 1em;
}
.prose .note {
  margin-top: 2.5rem;
  color: var(--espresso-soft);
  font-size: 0.9375rem;
}

/* ---------- Bewegung ---------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  @view-transition {
    navigation: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .js .service:not(.is-in) .service__sun path {
    transform: none;
  }
}

@media print {
  .header,
  .sun,
  .copy,
  .menu-btn {
    display: none !important;
  }
  .hero,
  .page {
    padding-top: 0;
  }
}
