/* ------------------------------------------------------------------
   Sigurður Ingi — sigurduringi.is
   White on black, like the logo's dark version: ink is off-white,
   paper is near-black, mist is the logo's 35% grey on that black.
   Outfit is the logo typeface; Overpass carries the text.
   ------------------------------------------------------------------ */

:root {
  --paper: #0a0a0a;
  --ink: #f2f0eb;
  --mist: #6e6d68;      /* the logo's 35% grey, on black */
  --hair: #262626;      /* hairlines */
  --font-display: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 38rem;
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 100%; /* 16px */
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-feature-settings: "kern", "liga";
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 500; }
svg { display: block; }

.skip-link {
  position: absolute; left: var(--gutter); top: -4rem;
  padding: .5rem .75rem; background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-size: .85rem; z-index: 20;
}
.skip-link:focus { top: 1rem; }

/* ---------- header ---------- */

.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.35rem var(--gutter);
  pointer-events: none;
  background: transparent;
  transition: background-color .5s var(--ease), backdrop-filter .5s var(--ease);
}
.site-head > * { pointer-events: auto; }
.past-hero .site-head {
  background-color: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
@supports not (background-color: color-mix(in srgb, #fff 50%, transparent)) {
  .past-hero .site-head { background-color: var(--paper); }
}

.head-mark {
  display: block; height: .95rem;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  pointer-events: none;
}
.head-mark-svg { height: 100%; width: auto; fill: var(--ink); }
.past-hero .head-mark { opacity: 1; transform: none; pointer-events: auto; }

.site-nav { display: flex; gap: clamp(1.25rem, 3vw, 2.25rem); }
.site-nav a,
.label,
.project-when,
.project-tags,
.specimen-note,
.objective-label,
.foot-login,
.foot-name {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.site-nav a {
  position: relative; padding: .25rem 0; color: var(--ink);
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.site-nav a:hover::after, .site-nav a:focus-visible::after {
  transform: scaleX(1); transform-origin: left;
}
.nav-login {
  display: inline-flex; align-items: center; gap: .45em;
  margin-left: clamp(.5rem, 2vw, 1.5rem);
  color: var(--mist);
  transition: color .3s;
}
.nav-login:hover, .nav-login:focus-visible { color: var(--ink); }
.nav-lock {
  width: .8em; height: auto;
  fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  margin-top: -.1em;
}
@media (max-width: 48rem) { .nav-login { display: none; } }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 6rem var(--gutter) 5rem;
}
.hero-inner {
  width: min(18rem, 60vw);
  display: grid; justify-items: center; gap: clamp(2rem, 5vh, 3.25rem);
}
.logo { width: 100%; height: auto; overflow: visible; }
.logo .wm-strong .glyph { fill: var(--ink); }
.logo .wm-soft .glyph, .logo .shape { fill: var(--mist); }
.logo .glyph, .logo .shape, .logo .shape-wrap, .logo .mark {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

/* Intro: the logo starts invisible and the script animates it in.
   Only when scripting is on; otherwise everything simply shows. */
.js .is-intro .logo .glyph,
.js .is-intro .logo #sphere,
.js .is-intro .logo .shape-wrap,
.js .is-intro .site-head { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .js .is-intro .logo .glyph,
  .js .is-intro .logo #sphere,
  .js .is-intro .logo .shape-wrap,
  .js .is-intro .site-head { opacity: 1; }
  .js .hero-inner { animation: fade-in .9s ease-out both; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- sections ---------- */

.section {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  column-gap: clamp(2rem, 6vw, 6rem);
  row-gap: 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) var(--gutter);
  border-top: 1px solid var(--hair);
}
.section + .section { border-top: 1px solid var(--hair); }
.label {
  color: var(--mist);
  align-self: start;
  position: sticky; top: 5.5rem;
  padding-top: .35rem;
}
.section-body { min-width: 0; }

@media (max-width: 48rem) {
  .section { grid-template-columns: 1fr; row-gap: 1.75rem; }
  .label { position: static; }
}

/* reveals */
.js .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- about ---------- */

.about .section-body { max-width: var(--measure); }
.lede {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 300;
  line-height: 1.32;
  letter-spacing: -.005em;
  text-wrap: pretty;
}
.about p + p { margin-top: 1.5rem; }
.services {
  display: flex; flex-wrap: wrap; gap: .5rem 1.75rem;
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--mist);
}
.services li { position: relative; padding-left: 1.1rem; }
.services li::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: .4rem; height: .4rem; border-radius: 50%;
  background: currentColor;
}
.services li:nth-child(odd)::before {
  border-radius: 0;
  background: none;
  border-left: .4rem solid currentColor;
  border-top: .4rem solid transparent;
  width: 0; height: 0;
}

/* ---------- work ---------- */

.work-list { border-top: 1px solid var(--hair); }
.project { border-bottom: 1px solid var(--hair); }

.project-head {
  all: unset;
  display: grid; width: 100%; box-sizing: border-box;
  grid-template-columns: 8rem minmax(0, 1fr) auto 1.5rem;
  align-items: baseline; column-gap: 1.5rem;
  padding: 1.5rem 0;
  cursor: pointer;
  color: var(--ink);
}
.project-head:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 6px; border-radius: 2px; }

.project-when, .project-tags { color: var(--mist); transition: color .4s var(--ease); }
.project-tags { text-align: right; letter-spacing: .08em; text-transform: none; font-size: .85rem; }
.project-name {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.15;
  transition: transform .5s var(--ease);
}
.project-head:hover .project-name { transform: translateX(.35rem); }
.project-head:hover .project-when, .project-head:hover .project-tags { color: var(--ink); }

.project-plus {
  position: relative; width: .8rem; height: .8rem; justify-self: end; align-self: center;
  transition: transform .5s var(--ease);
}
.project-plus::before, .project-plus::after {
  content: ""; position: absolute; background: var(--ink);
}
.project-plus::before { left: 0; right: 0; top: 50%; height: 1px; margin-top: -.5px; }
.project-plus::after { top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -.5px; }
.project.open .project-plus { transform: rotate(45deg); }

.project-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .6s var(--ease);
}
.project.open .project-body { grid-template-rows: 1fr; }
.project-body-inner { min-height: 0; overflow: hidden; }
.project-cols {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 4rem);
  padding: .5rem 0 2rem 8rem;
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.project.open .project-cols { opacity: 1; transform: none; transition-delay: .1s; }
.project-text { max-width: var(--measure); }
.project-text p + p, .project-text p + .highlights { margin-top: 1.25rem; }
.highlights { margin: 0; display: grid; gap: 1rem; }
.highlights dt { font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
.highlights dd { margin: .2rem 0 0; color: var(--ink); opacity: .82; }
.project-aside { display: grid; gap: 1.5rem; align-content: start; }
.objective { font-style: italic; font-size: 1.1rem; max-width: 26rem; }
.objective-label { display: block; font-style: normal; color: var(--mist); margin-bottom: .5rem; }
.specimen {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -.005em;
  margin-top: .5rem;
}
.specimen-note { color: var(--mist); margin-top: -1rem; }
.f-epilogue { font-family: "Epilogue", var(--font-display); font-weight: 600; }
.f-vidaloka { font-family: "Vidaloka", var(--font-text); font-weight: 400; }

.swatches { display: flex; flex-wrap: wrap; gap: .75rem 1.1rem; }
.swatches li {
  display: grid; justify-items: center; gap: .45rem;
  font-family: var(--font-display); font-size: .68rem; letter-spacing: .06em; color: var(--mist);
}
.swatch {
  display: block; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.project-link, .contact-links a {
  font-family: var(--font-display);
  font-size: .95rem;
  display: inline-block;
  padding-bottom: .1rem;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 100% 1px;
  transition: background-size .45s var(--ease), color .3s;
}
.project-link:hover, .contact-links a:hover { background-size: 0 1px; }
.arrow {
  display: inline-block; width: .7em; height: .7em; margin-left: .4em; vertical-align: 0;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .45s var(--ease);
}
.project-link:hover .arrow, .contact-links a:hover .arrow { transform: translate(1.5px, -1.5px); }
.project-link:hover .arrow-down, .contact-links a:hover .arrow-down { transform: translateY(2px); }

@media (max-width: 48rem) {
  .project-head {
    grid-template-columns: minmax(0, 1fr) 1.5rem;
    grid-template-areas: "when plus" "name plus" "tags plus";
    row-gap: .3rem; padding: 1.25rem 0;
  }
  .project-when { grid-area: when; }
  .project-name { grid-area: name; }
  .project-tags { grid-area: tags; text-align: left; }
  .project-plus { grid-area: plus; }
  .project-head:hover .project-name { transform: none; }
  .project-cols { grid-template-columns: 1fr; padding-left: 0; padding-bottom: 2.25rem; }
}

/* ---------- contact ---------- */

.contact-lede { font-size: 1.15rem; color: var(--mist); }
.contact-mail {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.6vw, 3rem);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 2px;
  transition: background-size .55s var(--ease);
  padding-bottom: .15em;
}
.contact-mail:hover, .contact-mail:focus-visible { background-size: 100% 2px; }
.contact-links { display: flex; gap: 1.75rem; margin-top: 2.5rem; }

/* ---------- footer ---------- */

.site-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  max-width: 72rem; margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--hair);
  color: var(--mist);
}
.foot-login { transition: color .3s; }
.foot-login:hover { color: var(--ink); }

/* ---------- showreel ---------- */

.reel { padding-top: 0; border-top: 0; }
.reel-frame {
  position: relative; border-radius: 4px; overflow: hidden; background: #000;
  aspect-ratio: 16 / 9; /* keeps its box while the video is away in the theater */
  transition: transform .7s var(--ease), border-radius .7s var(--ease), box-shadow .7s var(--ease);
}
.reel-video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: #000; object-fit: cover;
}
.reel-open {
  all: unset; position: absolute; inset: 0; cursor: pointer;
  display: flex; align-items: flex-end; justify-content: flex-end; padding: 1.25rem 1.5rem;
  color: var(--ink);
}
.reel-open::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent 45%);
  opacity: 0; transition: opacity .6s var(--ease);
}
.reel-open:focus-visible { outline: 1.5px solid var(--ink); outline-offset: -6px; border-radius: inherit; }
.reel-hint {
  position: relative; width: 1.25rem; height: 1.25rem;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: translateY(8px) scale(.9);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
@media (hover: hover) and (min-width: 48.01rem) {
  .reel-frame:hover, .reel-frame:has(.reel-open:focus-visible) {
    transform: translateY(-3px) scale(1.012); border-radius: 10px;
    box-shadow: 0 34px 80px -28px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .09);
  }
  .reel-frame:hover .reel-open::before, .reel-open:focus-visible::before { opacity: 1; }
  .reel-frame:hover .reel-hint, .reel-open:focus-visible .reel-hint { opacity: 1; transform: none; }
}
@media (max-width: 48rem) { .reel-open { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .reel-frame, .reel-open::before, .reel-hint { transition: none; }
  .reel-frame:hover, .reel-frame:has(.reel-open:focus-visible) { transform: none; }
}

/* theater mode */
.theater {
  position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink);
  display: none; place-items: center;
}
.theater[open] { display: grid; }
.theater::backdrop { background: transparent; }
.theater-shade { position: absolute; inset: 0; background: rgba(6, 6, 6, .94); }
.theater-stage { position: relative; width: min(92vw, calc(88vh * 16 / 9)); }
.theater-stage video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: #000; border-radius: 6px; transform-origin: 0 0;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 1);
}
.theater-close {
  all: unset; position: absolute; top: 1.25rem; right: var(--gutter);
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center; cursor: pointer;
  color: var(--ink); border-radius: 50%;
  transition: background-color .3s, transform .5s var(--ease);
}
.theater-close svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.theater-close:hover { background: rgba(255, 255, 255, .08); transform: rotate(90deg); }
.theater-close:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.theater-open { overflow: hidden; }
.has-cursor.theater-open, .has-cursor.theater-open * { cursor: auto !important; }
.theater-open .cursor { opacity: 0 !important; }

/* ---------- project image strips ---------- */

.project-mark { display: block; height: 3rem; width: auto; margin-bottom: -.5rem; }

.strip {
  display: flex; gap: 1rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 0 0 3rem 8rem;
  scroll-padding-left: 8rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.strip::-webkit-scrollbar { display: none; }
.project.open .strip { opacity: 1; transform: none; transition-delay: .2s; }
.strip li {
  flex: 0 0 auto; height: clamp(13rem, 28vw, 22rem);
  scroll-snap-align: start;
}
.strip img, .strip video { display: block; height: 100%; width: auto; }
.strip .photo, .strip video { border-radius: 4px; }
.strip li:last-child { padding-right: var(--gutter); }

@media (max-width: 48rem) {
  .project-cols { padding-bottom: 1.5rem; }
  .strip {
    margin-inline: calc(-1 * var(--gutter));
    padding: 0 0 2.25rem var(--gutter);
    scroll-padding-left: var(--gutter);
  }
  .strip li { height: clamp(11rem, 52vw, 15rem); }
}

/* ---------- mobile: the whole header stays out of the way until the hero is gone ---------- */

@media (max-width: 48rem) {
  .site-head {
    opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity .5s var(--ease), transform .5s var(--ease), background-color .5s var(--ease);
  }
  .site-head > * { pointer-events: none; }
  .past-hero .site-head { opacity: 1; transform: none; }
  .past-hero .site-head > * { pointer-events: auto; }
}

/* ---------- cursor: the logo's triangle, which becomes the sphere over anything clickable ---------- */

@media (hover: hover) and (pointer: fine) {
  .has-cursor, .has-cursor * { cursor: none !important; }
  .cursor {
    position: fixed; left: 0; top: 0; z-index: 1000;
    width: 48px; height: 48px; margin: -16px 0 0 -16px;
    pointer-events: none;
    mix-blend-mode: difference;
    opacity: 0; transition: opacity .25s;
    will-change: transform;
  }
  .cursor.on { opacity: 1; }
  .cursor svg { display: block; width: 100%; height: 100%; overflow: visible; }
  .cursor path { fill: #fff; }
}
