/* KYNEO — base styles layered on top of the Tailwind CDN theme. */

:root {
  /* Layout stops widening past this. Without a cap the hero's 5-of-12 photo
     column keeps getting more landscape as the screen widens, and object-cover
     eats the top and bottom of a 2:3 portrait — on a 32" you end up with just
     the face. The nav cap is inset by its own 48px padding so the wordmark stays
     flush with the hero headline. */
  --shell: 1800px;
  --margin-desktop: 48px;

  /* The nav is fixed, so everything below it has to be offset by its exact
     height. This was hard-coded to 80px while the bar actually measures 86px
     on mobile and 93px above md, which tucked the top of the page and every
     anchor target underneath it. */
  --nav-h: 86px;
}

@media (min-width: 768px) {
  :root { --nav-h: 93px; }
}

/* Done in CSS rather than Tailwind arbitrary values: the CDN build won't
   resolve a bare var() inside `pt-[...]`, so those classes silently produced
   nothing. An element selector also lets links.html keep its larger pt-32,
   since a utility class outranks it. */
main {
  padding-top: var(--nav-h);
}

/* Anchor targets stop below the fixed bar instead of behind it. */
[id] {
  scroll-margin-top: var(--nav-h);
}

@media (min-width: 1024px) {
  .hero-grid {
    min-height: calc(90vh - var(--nav-h));
  }
}

main,
footer {
  max-width: var(--shell);
  margin-inline: auto;
}

nav > div {
  max-width: calc(var(--shell) - 2 * var(--margin-desktop));
  margin-inline: auto;
}

body {
  background-color: #131313;
  color: #e5e2e1;
  -webkit-font-smoothing: antialiased;
  cursor: crosshair;
}

/* Film grain. Self-contained SVG noise so the site has no image dependency. */
.grain-overlay {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

/* Below lg the portrait is full-bleed behind the type, so it fills and crops. */
.hero-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Melts the portrait's edge into the page so there is no visible photo boundary.
   Mobile: fade upward, type sits on black. Desktop: fade leftward into the type column. */
.hero-fade {
  background: linear-gradient(
    to top,
    #131313 0%,
    rgba(19, 19, 19, 0.92) 22%,
    rgba(19, 19, 19, 0.55) 44%,
    rgba(19, 19, 19, 0) 72%
  );
  pointer-events: none;
}

@media (min-width: 1024px) {
  .hero-fade {
    background: linear-gradient(
      to right,
      #131313 0%,
      rgba(19, 19, 19, 0.65) 14%,
      rgba(19, 19, 19, 0) 40%
    );
  }
}

/* ---- Entry gate --------------------------------------------------------- */

.entry-locked,
.entry-locked body {
  overflow: hidden;
}

.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #131313;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
  opacity: 1;
  transition: opacity 500ms ease;
}

.entry-gate--out {
  opacity: 0;
  pointer-events: none;
}

.entry-gate__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 16px;
  text-align: center;
}

.entry-gate__mark {
  font-size: clamp(56px, 14vw, 132px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: #e5e2e1;
}

.entry-gate__meta {
  color: #cfc4c5;
  letter-spacing: 0.2em;
}

.entry-gate__btn {
  border: 1px solid #988e90;
  background: transparent;
  color: #e5e2e1;
  padding: 16px 64px;
  cursor: crosshair;
}

.entry-gate__btn:hover {
  background: #e5e2e1;
  color: #131313;
}

.entry-gate__note {
  color: #ffb4a8;
  letter-spacing: 0.2em;
}

@media (prefers-reduced-motion: reduce) {
  .entry-gate { transition: none; }
}

/* Full-viewport grain, as used on the links page. */
.grain-fixed {
  position: fixed;
  inset: 0;
  z-index: 40;
  filter: contrast(150%);
}

.hover-invert:hover {
  background-color: #e5e2e1;
  color: #131313;
}

.divider-x {
  height: 1px;
  width: 100%;
  background-color: #4c4546;
}

.divider-y {
  width: 1px;
  height: 100%;
  background-color: #4c4546;
}

.industrial-hover:hover {
  background-color: #e5e2e1;
  color: #131313;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Tactile press, done in CSS rather than by writing inline transforms from JS —
   a mouseup that lands outside the button never fires, so the JS version could
   leave a button stuck at 0.98. */
button:active {
  transform: scale(0.98);
}

/* ---- Archive page ------------------------------------------------------- */

.divider-thin {
  height: 1px;
  background-color: #4c4546;
}

.industrial-active {
  color: #d53e2d;
}

/* Filter buttons: aria-pressed is the single source of truth for the active
   state, so the styling can't drift from what screen readers are told. */
.filter-btn {
  color: #e5e2e1;
  border-color: #4c4546;
}
.filter-btn:hover {
  border-color: #e5e2e1;
}
.filter-btn[aria-pressed="true"] {
  background-color: #e5e2e1;
  border-color: #e5e2e1;
  color: #131313;
}

.track-active {
  background-color: #1c1b1b;
  box-shadow: inset 2px 0 0 #ffb4a8;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Travels the height of the hero. Translating by its own 2px height, as the
   original did, left it sitting still. */
@keyframes scanline {
  0%   { transform: translateY(0); }
  100% { transform: translateY(90vh); }
}

.scanline {
  width: 100%;
  height: 2px;
  top: 0;
  background: rgba(255, 180, 168, 0.08);
  position: absolute;
  pointer-events: none;
  animation: scanline 8s linear infinite;
}

/* Keyboard focus — the design has no rounded corners or glow, so keep it hard. */
:focus-visible {
  outline: 2px solid #ffb4a8;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #e5e2e1;
  color: #131313;
  padding: 12px 16px;
}
.skip-link:focus {
  left: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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