/* Nylsen: black and white, calm, a lot of empty space. */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/cormorant-garamond-latin-300-normal.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #0b0b0b;
  --paper: #fbfbfa;
  --muted: #6d6d6a;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
/* No box on tap or click; a thin outline for keyboard focus only. */
a:focus { outline: none; }
a:focus-visible { outline: 1px solid currentColor; outline-offset: 6px; }

/* Navigation: small, black, on the white top of the screen. */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(20px, 4vw, 56px);
}
.logo { display: block; width: 30px; height: 30px; position: relative; }
.logo svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.logo .color { opacity: 0; }
.logo:hover .mono, .logo:focus-visible .mono { opacity: 0; }
.logo:hover .color, .logo:focus-visible .color { opacity: 1; }
.logo:hover svg { transform: rotate(-6deg) scale(1.06); }
.links { display: flex; gap: clamp(20px, 3vw, 40px); list-style: none; }
.links a {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  position: relative;
  padding: 6px 0;
}
.links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.links a:hover::after, .links a[aria-current='page']::after { transform: scaleX(1); transform-origin: left; }

/* Inner pages: the content scrolls under the menu, so the menu fades it out. */
body:not(.home) .nav {
  padding-bottom: 56px;
  background: linear-gradient(to bottom, var(--paper) 0, var(--paper) 55%, rgba(251, 251, 250, 0) 100%);
}

/* Landing: full-screen landscape, moving fog, name in the centre. */
.hero { position: fixed; inset: 0; overflow: hidden; background: #e9e9e7; }
.landscape {
  position: absolute;
  inset: -2%;
  background: url('img/landscape.webp') center 60% / cover no-repeat;
  filter: blur(1.5px);
  animation: appear 1.4s ease-out both, drift 26s ease-in-out infinite alternate;
}
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 900px) {
  .landscape { background-image: url('img/landscape-1280.webp'); background-position: 38% 60%; }
}
@keyframes drift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.16) translate3d(-3%, -2%, 0); }
}

.fog {
  position: absolute;
  left: 0;
  height: 100%;
  width: calc(2 * 266.67vh);
  background: url('img/fog.svg') left center / auto 100% repeat-x;
  will-change: transform;
  pointer-events: none;
}
.fog.one { top: 14%; opacity: 0.8; animation: flow 64s linear infinite; }
.fog.two { top: 32%; opacity: 0.65; animation: flow-flip 44s linear infinite reverse; }
.fog.three { top: 46%; opacity: 0.55; animation: flow 30s linear infinite; filter: blur(6px); }
/* A phone shows a narrow part of the fog, so the fog looks thicker: make it lighter. */
@media (max-width: 900px) {
  .fog.one { opacity: 0.45; }
  .fog.two { opacity: 0.35; }
  .fog.three { opacity: 0.3; }
}
@keyframes flow {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-266.67vh, 0, 0); }
}
@keyframes flow-flip {
  from { transform: translate3d(0, 0, 0) scaleY(-1); }
  to { transform: translate3d(-266.67vh, 0, 0) scaleY(-1); }
}

/* Dark shade from the bottom, so the white footer stays readable. */
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 34vh;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0, rgba(0, 0, 0, 0.22) 45%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

/* White veil from the top, so the black menu stays readable. */
.veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(251, 251, 250, 0.92) 0, rgba(251, 251, 250, 0.55) 14vh, rgba(251, 251, 250, 0) 32vh);
}

.name {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.name h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(44px, 11vw, 190px);
  letter-spacing: 0.42em;
  margin-right: -0.42em; /* The last letter has spacing too: keep the word centred. */
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  opacity: 0;
  animation: reveal 2.4s var(--ease) 0.3s forwards;
}
@media (max-width: 600px) {
  .name h1 { font-size: 9.5vw; letter-spacing: 0.32em; margin-right: -0.32em; animation-name: reveal-small; }
}
@keyframes reveal-small {
  from { opacity: 0; letter-spacing: 0.5em; filter: blur(8px); }
  to { opacity: 1; letter-spacing: 0.32em; filter: blur(0); }
}
@keyframes reveal {
  from { opacity: 0; letter-spacing: 0.6em; filter: blur(8px); }
  to { opacity: 1; letter-spacing: 0.42em; filter: blur(0); }
}

.foot {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  padding: 24px clamp(20px, 4vw, 56px);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Language links: small, the current one underlined. */
.langs { display: flex; gap: 14px; }
.langs a { opacity: 0.75; padding: 6px 0; border-bottom: 1px solid transparent; transition: opacity 0.4s var(--ease); }
.langs a:hover { opacity: 1; }
.langs a[aria-current] { opacity: 1; border-bottom-color: currentColor; }

/* Projects page. */
.page { max-width: 980px; margin: 0 auto; padding: 22vh clamp(20px, 4vw, 56px) 14vh; }
.page h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 10vh;
}
.project {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px 56px;
  padding: 48px 0;
  border-top: 1px solid rgba(11, 11, 11, 0.12);
}
.project:last-child { border-bottom: 1px solid rgba(11, 11, 11, 0.12); }
.project h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: 0.08em; }
.project .kind { font-family: var(--sans); margin-top: 8px; font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }
.project p { font-family: var(--serif); font-size: 21px; line-height: 1.55; }
.project .visit {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
}
.project.soon { color: var(--muted); }
.project.soon h2 { font-style: italic; }
.page-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 clamp(20px, 4vw, 56px) 32px; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 700px) {
  .project { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .landscape, .fog { animation: none; }
  .name h1 { animation: none; opacity: 1; }
}
