/* Icons — landing page
   Colours, type and spacing follow the Icons graphic profile 1.0. */

:root {
  --choklad: #2E251D;
  --beige: #EADCCB;
  --krita: #F7F3ED;
  --taupe: #756452;
  --koppar: #B67854;

  --font: "Inter", Arial, Helvetica, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(20px, 5vw, 96px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--choklad);
  background: var(--choklad);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

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

.wordmark { display: block; fill: currentColor; fill-rule: evenodd; overflow: hidden; }
.wordmark use { transform-box: fill-box; }

.eyebrow {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(234, 220, 203, .72);
}
.eyebrow--dark { color: var(--taupe); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--beige);
  background: var(--choklad);
  overflow: hidden;
  isolation: isolate;
}

/* Soft material grain — keeps the flat brown from feeling digital-dead */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .9 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.nav {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px var(--gutter);
}

.nav__links { display: flex; gap: 32px; }

.nav__logo { display: block; width: 168px; color: var(--beige); }
.nav__logo .wordmark { width: 100%; height: auto; }

.nav__link {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 0;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 8px) / 100% 1px no-repeat;
  transition: background-size 250ms var(--ease-out);
  opacity: 0;
  animation: fade 800ms var(--ease-out) 1.2s forwards;
}
.nav__link:hover { background-size: 0 1px; background-position: 100% calc(100% - 8px); }

/* Letters of the wordmark rise in one by one */
.nav__logo use,
.footer .wordmark use {
  transform: translateY(110%);
}
.nav__logo use {
  animation: letterIn 900ms var(--ease-out) forwards;
}
.nav__logo use:nth-child(1) { animation-delay: .30s; }
.nav__logo use:nth-child(2) { animation-delay: .36s; }
.nav__logo use:nth-child(3) { animation-delay: .42s; }
.nav__logo use:nth-child(4) { animation-delay: .48s; }
.nav__logo use:nth-child(5) { animation-delay: .54s; }
.nav__logo use:nth-child(6) { animation-delay: .60s; }

.hero__content {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 24px var(--gutter) 64px;
  max-width: 1100px;
  will-change: transform;
}

.headline {
  margin: 24px 0 32px;
  font-size: clamp(40px, 12.4vw, 128px);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -.035em;
}

.headline .line {
  display: block;
  overflow: hidden;
  /* room for descenders inside the mask */
  padding-bottom: .08em;
  margin-bottom: -.08em;
}
.headline .line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: lineIn 1100ms var(--ease-out) var(--d, 0s) forwards;
}

.lede {
  max-width: 34ch;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.6;
  color: rgba(234, 220, 203, .8);
  margin-bottom: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--choklad);
  background: var(--beige);
  transition: background-color 200ms ease, transform 200ms ease;
}
.button::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 200ms ease;
}
.button:hover { background: var(--krita); }
.button:hover::after { transform: translateY(0) rotate(45deg); }

.reveal-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 900ms var(--ease-out) var(--d, 0s) forwards;
}

/* The big icon — two halves that find each other */
.hero__mark {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: clamp(24px, 12vw, 220px);
  height: min(76vh, 780px);
  aspect-ratio: 240 / 1240;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero__mark svg { width: 100%; height: 100%; fill: var(--beige); }

.half { transform-box: view-box; }
.half--top    { transform: translateY(-120%); animation: halfIn 1500ms var(--ease-out) .15s forwards; }
.half--bottom { transform: translateY(120%);  animation: halfIn 1500ms var(--ease-out) .15s forwards; }

.cut {
  stroke: var(--koppar);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: .9;
  animation: draw 1600ms cubic-bezier(.65, 0, .35, 1) .05s forwards, cutRest 1200ms ease 1.8s forwards;
}

/* Slow ticker along the bottom edge */
.ticker {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(234, 220, 203, .14);
  background: var(--choklad);
  overflow: hidden;
  padding: 18px 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(234, 220, 203, .6);
  opacity: 0;
  animation: fade 1000ms ease 1.7s forwards;
}
.ticker__track {
  display: flex;
  align-items: center;
  gap: 32px;
  width: max-content;
  animation: ticker 48s linear infinite;
}
.ticker b { font-weight: 600; color: var(--beige); }
.ticker i {
  display: block;
  width: 7px;
  height: 14px;
  background: var(--koppar);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 0 38%);
}

/* ---------- Scrolling slogan band ---------- */

.band {
  background: var(--choklad);
  color: var(--beige);
  padding: clamp(40px, 6vw, 88px) 0 clamp(72px, 10vw, 150px);
  overflow: hidden;
  display: grid;
  gap: clamp(4px, 1vw, 16px);
}
.band__row { white-space: nowrap; }
.band__track {
  display: inline-flex;
  align-items: center;
  gap: clamp(24px, 3vw, 56px);
  padding-right: clamp(24px, 3vw, 56px);
  font-size: clamp(64px, 13vw, 220px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.045em;
  will-change: transform;
}
.band__row--outline .band__track span {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(234, 220, 203, .55);
}
.band__cut {
  flex: none;
  height: .62em;
  width: auto;
  fill: var(--koppar);
}

/* ---------- About ---------- */

.about {
  position: relative;
  background: var(--beige);
  padding: clamp(96px, 16vw, 240px) var(--gutter) clamp(64px, 12vw, 160px);
  margin-top: calc(-1 * clamp(56px, 9vw, 140px));
  /* top edge follows the angle of the cut in the icon */
  clip-path: polygon(0 0, 100% clamp(56px, 9vw, 140px), 100% 100%, 0 100%);
  display: grid;
  gap: clamp(48px, 7vw, 96px);
}

.about__intro { max-width: 760px; display: grid; gap: 24px; }

.about h2 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -.03em;
}

.about__intro p:last-child { max-width: 58ch; font-size: 18px; line-height: 1.65; }

.values {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.values li {
  position: relative;
  border-top: 1px solid rgba(46, 37, 29, .25);
  padding-top: 24px;
}
.values li::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--koppar);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 450ms var(--ease-out);
}
.values li:hover::before { transform: scaleX(1); }
.values li .values__num { transition: transform 300ms var(--ease-out), color 300ms ease; }
.values li:hover .values__num { transform: translateX(8px); color: var(--koppar); }
.values__num { display: block; font-size: 14px; font-weight: 500; color: var(--taupe); margin-bottom: 32px; }
.values h3 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 12px; }
.values p { max-width: 36ch; }

.in-view {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms var(--ease-out) var(--d, 0s), transform 900ms var(--ease-out) var(--d, 0s);
}
.in-view.is-visible { opacity: 1; transform: none; }

/* ---------- Our systems ---------- */

.work {
  background: var(--choklad);
  color: var(--beige);
  padding: clamp(64px, 10vw, 144px) var(--gutter) 0;
}

.work__title {
  font-size: clamp(48px, 8vw, 120px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.045em;
  padding-bottom: clamp(24px, 3vw, 40px);
  border-bottom: 1px solid rgba(234, 220, 203, .2);
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr) minmax(0, 2fr);
  grid-template-rows: auto 1fr auto;
  gap: 0 24px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(234, 220, 203, .2);
}

.project__media {
  grid-column: 1;
  grid-row: 1 / 4;
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(234, 220, 203, .14);
  border-radius: 8px;
  overflow: hidden;
  background: #271f18;
}
.project__media canvas,
.project__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project__text {
  grid-column: 2;
  grid-row: 1;
  max-width: 32ch;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(234, 220, 203, .85);
}

.project__name {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  text-align: right;
  font-size: clamp(24px, 2.6vw, 40px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -.03em;
}

.project__tags {
  grid-column: 2 / 4;
  grid-row: 3;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 500;
}
.project__tags li { position: relative; }
.project__tags li::before {
  content: "";
  position: absolute;
  left: -16px;
  top: .45em;
  width: 6px;
  height: 11px;
  background: var(--koppar);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 0 38%);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 250ms ease, transform 250ms var(--ease-out);
}
.project:hover .project__tags li::before { opacity: 1; transform: none; }

/* ---------- Footer ---------- */

.footer {
  color: var(--beige);
  background: var(--choklad);
  padding: clamp(64px, 9vw, 128px) var(--gutter) 32px;
  display: grid;
  gap: clamp(48px, 8vw, 112px);
}
.footer__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.footer__slogan { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.15; font-weight: 500; letter-spacing: -.03em; }
.footer__up { font-size: 14px; font-weight: 500; padding: 12px 0; text-underline-offset: 4px; }

.footer .wordmark { width: 100%; height: auto; }
.footer .wordmark use { transition: transform 1100ms var(--ease-out); }
.footer .wordmark.is-visible use { transform: none; }
.footer .wordmark use:nth-child(2) { transition-delay: .06s; }
.footer .wordmark use:nth-child(3) { transition-delay: .12s; }
.footer .wordmark use:nth-child(4) { transition-delay: .18s; }
.footer .wordmark use:nth-child(5) { transition-delay: .24s; }
.footer .wordmark use:nth-child(6) { transition-delay: .30s; }
/* once revealed, letters lift under the pointer */
.footer .wordmark.is-settled use { transition: transform 350ms var(--ease-out); transition-delay: 0s; }
.footer .wordmark.is-settled use:hover { transform: translateY(-8%); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid rgba(234, 220, 203, .14);
  font-size: 14px;
  color: rgba(234, 220, 203, .72);
}
.footer__bottom b { font-weight: 600; color: var(--beige); }

/* ---------- Keyframes ---------- */

@keyframes letterIn { to { transform: none; } }
@keyframes lineIn   { to { transform: none; } }
@keyframes halfIn   { to { transform: none; } }
@keyframes fade     { to { opacity: 1; } }
@keyframes fadeUp   { to { opacity: 1; transform: none; } }
@keyframes draw     { to { stroke-dashoffset: 0; } }
@keyframes cutRest  { to { opacity: .35; } }
@keyframes ticker   { to { transform: translateX(-50%); } }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .hero__mark {
    right: -4vw;
    height: 70vh;
    opacity: .16;
  }
  .values { grid-template-columns: 1fr; gap: 24px; }
  .project {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 16px;
  }
  .project__media,
  .project__text,
  .project__name,
  .project__tags { grid-column: 1; grid-row: auto; }
  .project__name { justify-self: start; text-align: left; margin-top: 8px; order: 1; }
  .project__text { order: 2; }
  .project__tags { order: 3; }
  .project__tags li::before { display: none; }
  .project__tags { margin-top: 8px; }
  .values__num { margin-bottom: 16px; }
}

@media (max-width: 480px) {
  .nav { padding-top: 24px; padding-bottom: 24px; }
  .nav__logo { width: 120px; }
  .nav__links { gap: 20px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0s !important;
  }
  .ticker__track { animation: none !important; }
}
