/*
  Project 1: stylesheet.
  Adapted from "Paradigm Shift" by HTML5 UP (html5up.net | @ajlkn), CCA 3.0 (html5up.net/license).
  Kept from the template: the #wrapper > section grid (left header rail, right content column),
  the vertical rail drawn by header::before with ticks on headings, the intro whose content fills
  the viewport, .image.main, the is-preload load sequence and the modal fade.
  Rewritten: palette, type, the intro gradient, the rail as taxiway lights, the native dialog viewer.
*/

:root {
  /* Ground and paint */
  --asphalt: #121318;
  --asphalt-deep: #0a0b0e;
  --paint: #ebe5d6;
  --paint-dim: rgba(235, 229, 214, 0.5);
  --paint-yellow: #e8b738;
  --sign-red: #b4121b;
  /* Lights */
  --ramp-red: #ff2f1f;
  --taxiway: #4b84ff;
  --taxiway-halo: rgba(75, 132, 255, 0.28);
  /* Text */
  --text: #d6d0c2;
  --muted: #8f8a80;
  /* Type */
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  /* Layout */
  --rail-col: clamp(15rem, 17vw, 20rem);
  --gutter: 5rem;
  --gap: 9rem;
}

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

html {
  background: var(--asphalt-deep);
  overflow-x: clip;
}

body {
  background: linear-gradient(to bottom, var(--asphalt) 0%, var(--asphalt) 55%, var(--asphalt-deep) 100%);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; }

a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--paint); }

:focus-visible { outline: 3px solid var(--paint-yellow); outline-offset: 4px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Wrapper and sections (template grid, re-proportioned: narrow rail, wide content) */

#wrapper {
  position: relative;
  width: 100%;
}

#wrapper > section {
  position: relative;
  display: grid;
  grid-template-areas: "header content";
  grid-template-columns: var(--rail-col) minmax(0, 1fr);
  align-items: start;
}

#wrapper > section + section { margin-top: var(--gap); }

#wrapper > section > header {
  grid-area: header;
  justify-self: end;
  text-align: right;
  width: 100%;
  padding: 0 4.5rem 0 2.5rem;
}

#wrapper > section > .content {
  grid-area: content;
  position: relative;
  padding: 0 var(--gutter) 0 4.5rem;
  max-width: 100rem;
}

/* The rail: taxiway edge lights running down the seam between header and content */

#wrapper > section.work > header::before,
#wrapper > section.statement > header::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(var(--rail-col) - 6px);
  width: 12px;
  height: calc(100% + var(--gap));
  background: radial-gradient(circle at 6px 6px, var(--taxiway) 0 2px, var(--taxiway-halo) 2.5px, transparent 6px) 0 0 / 12px 72px repeat-y;
  pointer-events: none;
}

#wrapper > section.work:first-of-type > header::before { top: 0; }

/* The last light on the rail is red: the end of the runway */
#wrapper > section.statement > header::before {
  height: calc(100% + 0.5rem);
}
#wrapper > section.statement > header::after {
  content: '';
  position: absolute;
  left: calc(var(--rail-col) - 6px);
  bottom: -1.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 6px 6px, var(--ramp-red) 0 2.5px, rgba(255, 47, 31, 0.35) 3px, transparent 6px);
}

/* Work headers: the caption sits level with the top of the image */

.work > header { padding-top: 0.25rem; }

.work .caption {
  font-style: italic;
  font-size: 1.2rem;
  color: var(--muted);
}

/* Images: full width of the content column, never cropped */

.image.main {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  cursor: zoom-in;
  font: inherit;
}

.image.main img {
  width: 100%;
  height: auto;
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.55);
}

.image.main .sign { margin-top: 1rem; opacity: 0.9; }
.image.main:hover .sign,
.image.main:focus-visible .sign { opacity: 1; }

/* Signs: small airfield sign lettering */

.sign {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.7rem 0.4rem;
  border-radius: 2px;
  background: var(--paint-yellow);
  color: #141210;
  border: 0;
}

.sign.close {
  background: var(--sign-red);
  color: #fff;
  cursor: pointer;
}

/* Statement */

.statement > header h2 {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  color: var(--paint);
  padding-top: 0.35rem;
}

.statement > header h2::before {
  content: '';
  position: absolute;
  top: 1rem;
  right: -4.5rem;
  width: 3rem;
  height: 3px;
  background: var(--paint-dim);
}

.statement > .content { max-width: calc(42rem + 9.5rem); }

.statement p {
  font-size: 1.3rem;
  line-height: 1.6;
  max-width: 42rem;
}

.statement p + p { margin-top: 1.1em; }

/* Footer credit */

.copyright {
  margin: var(--gap) 0 0 var(--rail-col);
  padding: 0 var(--gutter) 3rem 4.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Intro: a dusk gradient, night at the top, the last light low on the horizon,
   then down into the asphalt of the page */

#wrapper > section.intro {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  min-height: 640px;
  background:
    linear-gradient(to bottom,
      #0c0d19 0%,
      #15152c 18%,
      #261f3d 36%,
      #4a3148 52%,
      #874f4a 64%,
      #c97a4f 73%,
      #e9a86a 79%,
      #a8644a 85%,
      #3a2a2e 92%,
      var(--asphalt) 100%);
}

h1.title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(7rem, 12vw, 13rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: var(--paint);
  text-align: center;
  margin-top: -14vh;
  text-shadow: 0 2px 40px rgba(12, 13, 25, 0.5);
}

/* Load sequence: the title appears once the fonts are ready */

@media (prefers-reduced-motion: no-preference) {
  h1.title { transition: opacity 1.2s ease-out 0.2s; }
  body.is-preload h1.title { opacity: 0; }
}

/* Full-size view (template modal, as a native dialog) */

dialog {
  margin: auto;
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  color: var(--text);
}

dialog::backdrop { background: rgba(6, 7, 10, 0.96); }

dialog img {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  cursor: zoom-out;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.6);
}

dialog form {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: viewer-in 0.4s ease-out; }
  @keyframes viewer-in {
    from { opacity: 0; transform: translateY(0.75rem); }
  }
}
