/* Red Sheep | homepage
   No external fonts, no external requests. */

/* Lato, self-hosted (no requests to other sites). Light for big titles, regular for text, bold and black for labels. */
@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/lato-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/lato-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/lato-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 900; font-display: swap; src: url("../fonts/lato-latin-900-normal.woff2") format("woff2"); }


:root {
  --bg: #1b1c1f;
  --bg-2: #232427;
  --ink: #ece9e1;
  --ink-dim: #9a988f;
  --line: rgba(236, 233, 225, 0.14);
  --red: #d01317;
  --bar-h: 64px;
  --foot-h: 40px;
  --font: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  /* dotted pasture */
  background-image: radial-gradient(rgba(236, 233, 225, 0.085) 1.1px, transparent 1.4px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* soft vignette so the edges settle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
  z-index: 0;
}

a { color: inherit; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 12px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
  z-index: 5000;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none;
  font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 500;
}
.brand img { display: block; height: 28px; width: auto; }

.nav { display: flex; gap: clamp(18px, 2.6vw, 40px); }
.nav a {
  position: relative;
  text-decoration: none;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 8px 0;
  color: var(--ink);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 1px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }
.nav a:focus-visible, .brand:focus-visible, .btn:focus-visible, .panel-close:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 4px;
}

/* ---------- field ---------- */
.field {
  position: fixed;
  inset: var(--bar-h) 0 var(--foot-h) 0;
  z-index: 1;
  touch-action: manipulation;
}

.hint {
  position: absolute; left: clamp(16px, 3vw, 40px); bottom: 12px; margin: 0;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim);
  transition: opacity 0.8s ease; pointer-events: none;
}
.hint-touch { display: none; }
@media (hover: none) { .hint-fine { display: none; } .hint-touch { display: inline; } }
.hint.is-gone { opacity: 0; }

/* ---------- landscape: almost nothing, on purpose ---------- */
.land {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.land .hill { fill: none; stroke: #ece9e1; stroke-width: 1; }

/* what we do, in plain words */
.tagline {
  position: absolute; z-index: 3500; left: clamp(16px, 3vw, 40px); top: 10px;
  max-width: min(560px, 64vw); pointer-events: none;
}
.tagline-eyebrow {
  margin: 0 0 8px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--red);
  font-weight: 500;
}
.tagline h1 {
  margin: 0; font-weight: 400; font-size: clamp(21px, 2.5vw, 34px); line-height: 1.18; letter-spacing: -0.012em;
}

.ring {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 10;
  border: 1px solid rgba(236, 233, 225, 0.35);
  animation: ring 1.2s ease-out forwards;
}
@keyframes ring {
  from { transform: scale(0.05); opacity: 0.55; }
  to { transform: scale(1); opacity: 0; }
}

/* ---------- sheep ---------- */
.sheep {
  position: absolute; left: 0; top: 0;
  padding: 0; margin: 0; border: 0; background: none;
  cursor: pointer;
  touch-action: none;
  will-change: transform;
  -webkit-appearance: none; appearance: none;
  outline: none;
  user-select: none; -webkit-user-select: none;
}
.sheep.is-dragging { cursor: grabbing; }
.sheep .flip, .sheep .pitch { width: 100%; height: 100%; }
.sheep .flip { will-change: transform; }
.sheep .pitch { transform-origin: 70% 100%; }
.sheep svg { display: block; width: 100%; height: auto; overflow: visible; }

.sheep .wool { fill: var(--wool); }
.sheep .eye { fill: var(--eye); }
.sheep .halo {
  fill: none; stroke: var(--halo); stroke-width: 16; stroke-linejoin: round;
  opacity: 0; transition: opacity 0.18s ease;
}
.sheep.is-active .halo { opacity: 1; }
.sheep:focus-visible .halo { opacity: 1; }

/* little label that follows the sheep on hover for the sheer clarity of it */
.bleat {
  position: absolute; left: 0; top: 0;
  font-size: 11px; letter-spacing: 0.08em; color: var(--ink-dim);
  pointer-events: none; z-index: 4000; opacity: 0;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}
.bleat.on { opacity: 0.9; }

/* ---------- footer ---------- */
.foot {
  position: fixed; inset: auto 0 0 0; height: var(--foot-h);
  display: flex; align-items: center; justify-content: flex-end; gap: 24px;
  padding: 0 clamp(16px, 3vw, 40px);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
  z-index: 5000; pointer-events: none;
}
.foot span:first-child { display: none; }

/* ---------- preview card ---------- */
.card {
  position: fixed; left: 0; top: 0; z-index: 4500;
  width: 292px; max-width: calc(100vw - 24px);
  background: rgba(30, 31, 34, 0.96);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(6px);
}
.card.is-in { opacity: 1; transform: none; }
.card[hidden] { display: none; }

.card-kicker {
  margin: 0 0 8px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim);
}
.card-kicker::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--dot, var(--ink)); margin-right: 9px; vertical-align: 1px;
}
.card-title { margin: 0 0 6px; font-size: 21px; line-height: 1.2; font-weight: 500; letter-spacing: -0.005em; }
.card-title em, .panel-title em { font-style: italic; }
.card-meta { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.06em; color: var(--ink-dim); }
.card-text { margin: 0 0 16px; font-size: 14px; color: #cfccc3; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; color: var(--ink); cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; font: inherit; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn::after { content: "\2192"; letter-spacing: 0; }
.btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-solid:hover { background: #e01a1f; border-color: #e01a1f; color: #fff; }
.btn.is-disabled { opacity: 0.5; pointer-events: none; }

/* ---------- expanded panel ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 6000; background: rgba(10, 10, 12, 0.55);
  opacity: 0; transition: opacity 0.25s ease;
}
.scrim.is-in { opacity: 1; }
.scrim[hidden], .panel[hidden] { display: none; }

.panel {
  position: fixed; z-index: 6100; top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw);
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  padding: clamp(28px, 4vw, 48px) clamp(22px, 3.2vw, 44px) 40px;
  overflow-y: auto;
  transform: translateX(24px); opacity: 0;
  transition: transform 0.3s cubic-bezier(.2, .7, .2, 1), opacity 0.25s ease;
}
.panel.is-in { transform: none; opacity: 1; }
.panel-close {
  position: absolute; top: 18px; right: 18px; width: 40px; height: 40px;
  background: none; border: 0; color: var(--ink); cursor: pointer; border-radius: 50%;
  display: grid; place-items: center;
}
.panel-close:hover { background: rgba(236, 233, 225, 0.1); }
.panel-title { margin: 6px 0 8px; font-size: clamp(30px, 4vw, 40px); line-height: 1.1; font-weight: 500; letter-spacing: -0.015em; }

.panel-media {
  margin: 20px 0 24px; aspect-ratio: 16 / 9; border-radius: 4px;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(236, 233, 225, 0.12) 1.1px, transparent 1.4px);
  background-size: 18px 18px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim);
}
.panel-body p { margin: 0 0 14px; color: #cfccc3; max-width: 52ch; }
.panel-body dl { margin: 18px 0 26px; display: grid; grid-template-columns: auto 1fr; gap: 8px 22px; font-size: 13px; }
.panel-body dt { color: var(--ink-dim); letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; padding-top: 2px; }
.panel-body dd { margin: 0; }

.noscript { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 10; color: var(--ink-dim); text-align: center; padding: 0 24px; }

/* ---------- small screens: nav moves to the thumb zone ---------- */
@media (max-width: 640px) {
  :root { --bar-h: 54px; --foot-h: 64px; }
  .tagline { top: 6px; max-width: 74vw; }
  .tagline-eyebrow { font-size: 10px; margin-bottom: 5px; }
  .tagline h1 { font-size: 18px; }
  .brand { font-size: 12px; }
  .brand img { height: 24px; }
  .bar .nav {
    position: fixed; left: 0; right: 0; bottom: 0; height: var(--foot-h);
    padding: 0 16px calc(env(safe-area-inset-bottom, 0px) * 0.6);
    justify-content: space-between; align-items: center;
    background: linear-gradient(to top, rgba(27, 28, 31, 0.96) 60%, rgba(27, 28, 31, 0));
    pointer-events: auto;
  }
  .nav a { font-size: 11px; letter-spacing: 0.14em; padding: 14px 4px; }
  .foot { display: none; }
  .hint { bottom: 8px; left: 16px; }
  .card { width: calc(100vw - 24px); max-width: none; } /* position is set in JS, away from the sheep */
  .panel { width: 100vw; border-left: 0; }
}

@media (min-width: 641px) {
  .foot span:first-child { display: inline; }
  .foot { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .panel, .scrim, .hint, .veil, .invite, .nav a::after { transition: none; }
}

/* the invitation: after a while with no input the field dims and a card appears in the middle */
.veil {
  position: absolute; inset: 0; z-index: 3600; pointer-events: none;
  background: rgba(27, 28, 31, 0.68);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 2s ease;
}
.invite {
  position: absolute; left: 50%; top: 50%; z-index: 3700; pointer-events: none;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 32px));
  padding: clamp(26px, 3.4vw, 40px) clamp(24px, 3.4vw, 40px) clamp(28px, 3.6vw, 42px);
  background: var(--bg-2); border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  opacity: 0; transition: opacity 2s ease;
}
.veil.is-in, .invite.is-in { opacity: 1; transition-duration: 0.8s; }
.invite .panel-title { margin: 6px 0 0; font-size: clamp(26px, 3.4vw, 34px); }

/* project poster, shown in the panel when the project has one: the whole poster, not a crop */
.panel-media.has-image {
  background-color: var(--bg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
