/* ============================================
   KNITS BY LOTTI — Editorial Portfolio
   ============================================ */

:root {
  --bg: #F8F7F3;
  --text: #1E1E1E;
  --accent-red: #C70202;
  --line: rgba(30, 30, 30, 0.12);
  --nav-h: 116px;
  --measure: 62ch;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Libertinus Sans", "Jost", sans-serif;
  --font-body: "Jost", "Libertinus Sans", sans-serif;
}

* { box-sizing: border-box; }
figure { margin: 0; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.6;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 6vw;
}

/* ---------- Focus & accessibility ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--bg);
  color: var(--text);
  padding: 12px 20px;
  z-index: 999;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  background: transparent;
  color: #F8F7F3;
  border-bottom: 1px solid transparent;
  z-index: 100;
}
.nav.is-scrolled {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--text);
}
.nav--solid {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--text);
}
.nav.is-menu-open {
  background: var(--bg);
  color: var(--text);
  border-bottom-color: var(--text);
}
.nav__inner {
  height: 100%;
  padding: 0 6vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav__logo img {
  height: 34px;
  width: auto;
  filter: invert(1);
}
.nav.is-scrolled .nav__logo img { filter: none; }
.nav--solid .nav__logo img { filter: none; }
.nav.is-menu-open .nav__logo img { filter: none; }
.nav__menu {
  list-style: none;
  display: flex;
  gap: clamp(24px, 3.4vw, 52px);
  margin: 0;
  padding: 0;
}
.nav__menu a {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: currentColor;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav__menu a::before {
  content: attr(data-text);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 700;
}
.nav__menu a:hover {
  font-weight: 700;
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  margin: 6px 0;
}
.nav__menu.is-open { color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30,30,30,0.22) 0%, rgba(30,30,30,0) 32%, rgba(30,30,30,0) 62%, rgba(30,30,30,0.4) 100%);
}
.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 6vw 9vh;
  color: #F8F7F3;
  text-align: center;
}
.hero__headline {
  font-size: clamp(2.8rem, 6.6vw, 5.6rem);
  line-height: 1.1;
  max-width: 26ch;
  margin: 0 auto;
  opacity: 0;
  animation: rise-in 1.1s var(--ease) 0.5s forwards;
}
.hero__intro {
  margin: 28px auto 0;
  max-width: 40ch;
  font-size: 17px;
  opacity: 0;
  animation: rise-in 1.1s var(--ease) 0.75s forwards;
}

@keyframes rise-in {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--text);
  color: #F8F7F3;
  border: 1px solid var(--text);
  padding: 17px 36px;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
.btn:hover { background: #F8F7F3; color: var(--text); }

.btn--ghost {
  background: transparent;
  color: #F8F7F3;
  border-color: #F8F7F3;
}
.btn--ghost:hover { background: #F8F7F3; color: var(--text); }

.btn--outline {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text);
}
.btn--outline:hover { background: var(--text); color: var(--bg); }
#email-cta { scroll-margin-top: calc(var(--nav-h) + 24px); }

/* ---------- Section rhythm ---------- */
section { padding: clamp(88px, 14vh, 200px) 0; }
.section-head {
  max-width: var(--measure);
  margin-bottom: clamp(40px, 6vh, 72px);
}
.section-head h2 {
  font-size: clamp(2.3rem, 4.6vw, 3.5rem);
  margin-top: 14px;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Story ---------- */
.story {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(48px, 9vw, 160px);
  align-items: center;
}
.story__media { overflow: hidden; }
.story__media img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}
.story__text {
  padding: 0 6vw 0 0;
}
.story__text h2 {
  font-size: clamp(4rem, 8vw, 7.6rem);
  line-height: 1.3;
  margin: 0 0 32px;
}
.story__text p { max-width: 44ch; margin: 0; color: var(--text); font-size: 19px; }

/* ---------- Work ---------- */
.work { background: var(--bg); padding-top: clamp(40px, 6vh, 100px); }
.work__layout {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}
.work .section-head {
  flex: 0 0 clamp(280px, 30vw, 420px);
  max-width: clamp(280px, 30vw, 420px);
  padding-left: 6vw;
}
.work .section-head p { margin-top: 18px; max-width: 44ch; color: var(--text); font-size: 19px; }
.work__gallery { position: relative; }
.work__arrow {
  display: none;
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.work__grid {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  padding: 4px 6vw 28px 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-left: 6vw;
  scrollbar-width: thin;
  scrollbar-color: rgba(30,30,30,0.3) transparent;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.work__grid::-webkit-scrollbar { height: 3px; }
.work__grid::-webkit-scrollbar-track { background: transparent; }
.work__grid::-webkit-scrollbar-thumb { background: rgba(30,30,30,0.3); }
.work__grid:focus-visible { outline: 2px solid var(--text); outline-offset: -4px; }
.work__item {
  flex: 0 0 clamp(220px, 50vw, 380px);
  overflow: hidden;
  scroll-snap-align: start;
}
.work__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/5;
}
.work__item figcaption {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-body);
}
.work__item figcaption .work__name {
  font-size: 14px;
  letter-spacing: 0.03em;
}
.work__item figcaption .work__year {
  font-size: 12px;
  color: rgba(30,30,30,0.5);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---------- Email CTA ---------- */
.cta { text-align: center; padding-top: clamp(24px, 4vh, 64px); }
.cta .container { display: flex; flex-direction: column; align-items: center; gap: 40px; }
.cta__text { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 0.35em; }
.cta__prefix {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  text-transform: uppercase;
  line-height: 1.3;
  margin: 0;
}
.cta__line {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  text-transform: uppercase;
  line-height: 1.3;
  margin: 0;
}
.cta__rotator {
  display: inline-block;
  min-width: 22ch;
  text-align: center;
  font-style: italic;
  text-transform: none;
  opacity: 1;
  transition: opacity 0.4s var(--ease);
}
.cta__rotator.is-swapping { opacity: 0; }

/* ---------- Instagram ---------- */
.instagram {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.instagram__bg {
  position: absolute;
  inset: 0;
}
.instagram__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.instagram__scrim {
  position: absolute;
  inset: 0;
  background: rgba(30,30,30,0.42);
}
.instagram__content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #F8F7F3;
}
.instagram__content h2 { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.2; margin: 12px 0 30px; text-transform: none; }

@media (min-width: 861px) {
  .instagram { min-height: 820px; }
}

/* ---------- Footer ---------- */
.footer {
  padding: 64px 0 40px;
  text-align: center;
  background: var(--bg);
  color: var(--accent-red);
}
.footer__symbol img { width: 30px; margin: 0 auto 28px; }
.footer__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 30px;
  margin: 0 0 30px;
  padding: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer__links a {
  position: relative;
  display: inline-block;
  color: var(--accent-red);
  text-decoration: none;
}
.footer__links a::before {
  content: attr(data-text);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 700;
}
.footer__links a:hover { font-weight: 700; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
}
.footer__meta { color: var(--accent-red); }
.footer__legal {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
}
.footer__legal a {
  position: relative;
  display: inline-block;
  color: var(--accent-red);
  text-decoration: none;
}
.footer__legal a::before {
  content: attr(data-text);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 700;
}
.footer__legal a:hover { font-weight: 700; }
.footer a:focus-visible { outline-color: var(--accent-red); }

/* ---------- Impressum page ---------- */
.legal {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 100px;
}
.legal .container { max-width: 780px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 32px; }
.legal h2 { font-size: 1.1rem; margin: 40px 0 12px; }
.legal p { max-width: var(--measure); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  :root { --nav-h: 80px; }


  .footer__bottom { justify-content: center; text-align: center; }

  .nav__menu {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    opacity: 0;
    pointer-events: none;
  }
  .nav__menu.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .nav__menu a { font-size: 16px; }
  .nav__toggle { display: block; }

  .story { grid-template-columns: 1fr; }
  .story__media { order: 1; }
  .story__text { order: 0; }
  .story__text { padding: 40px 6vw 0; }

  .work__layout { flex-direction: column; align-items: stretch; }

  .work { padding-top: 24px; }
  .work__item { flex: 0 0 94vw; }
  .work__arrow { display: block; width: 72px; height: 72px; }
  .work .section-head { flex-basis: auto; max-width: none; padding-left: 6vw; padding-right: 6vw; }
  .work__grid { padding-left: 6vw; padding-right: 0; margin-top: 20px; gap: 4px; scrollbar-width: none; }
  .work__grid::-webkit-scrollbar { display: none; }
}

@media (max-width: 480px) {
  .hero__content { padding-bottom: 12vh; }
  .hero__headline { font-size: 3.4rem; max-width: 15ch; }
  .story { padding-top: 32px; }
  .story__media img { aspect-ratio: 16/9; max-height: 84vh; }
  .story__text h2 { font-size: 3.4rem; }
  .section-head h2 { font-size: 3.4rem; line-height: 1.1; }
  .work__title-line { display: block; }
  .cta__text { flex-direction: column; align-items: center; gap: 4px; }
  .cta__qmark { display: none; }
  .cta__rotator { min-width: 0; }
  .cta__line { font-size: 1.6rem; }
}
