/* =============================================
   TOKENS
   Ink colors are lifted from the 12-color palette
   of the dithered sky, so the paper and the
   photograph belong to each other.
   Contrast measured against --paper (#E8E4DA).
   ============================================= */

:root {
  /* paper + sky */
  --paper: #E8E4DA;
  --paper-inset: #FCFAE2;
  --sky-base: #6A94AB;

  /* ink */
  --ink: #201A0B;         /* 13.6:1 */
  --ink-soft: #4A4336;    /*  7.7:1 */
  --ink-muted: #5A5244;   /*  6.1:1 */
  --link: #2B347C;        /*  8.8:1 */
  --accent: #A9220F;      /*  5.7:1 */

  --rule: rgb(32 26 11 / 0.22);
  --shadow: rgb(32 26 11 / 0.22);

  /* form */
  --notch: 16px;
  --pad-panel: 24px;      /* >= notch + 8, or the mask eats the content */
  --gap-panel: 32px;
  --max-w: 880px;
  --measure: 68ch;

  /* type */
  --font-serif: 'Domine', Georgia, 'Times New Roman', serif;
  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-base: 1rem;
  --t-md: 1.1875rem;
  --t-lg: 1.4375rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.125rem;

  --lh-tight: 1.25;
  --lh-body: 1.6;
}


/* =============================================
   RESET
   ============================================= */

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

html {
  font-family: var(--font-serif);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sky-base);
  color: var(--ink);
  font-size: var(--t-base);
  line-height: var(--lh-body);
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--link);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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


/* =============================================
   SKY
   Fixed layer, translated by JS at 0.3x scroll.
   The image is not tileable (its edges do not
   meet), so: cover, never repeat, over a base
   color drawn from the sky's dominant tone.
   ============================================= */

.sky {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: 100vh;          /* JS raises this to cover the parallax travel */
  z-index: 0;
  pointer-events: none;

  background-color: var(--sky-base);
  background-image: url(./assets/images/clouds-dither.webp);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;

  will-change: transform;
}


/* =============================================
   PAGE SHELL
   ============================================= */

.page {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap-panel) 16px calc(var(--gap-panel) * 2);
  display: flex;
  flex-direction: column;
  gap: var(--gap-panel);
}

main {
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap-panel) * 1.5);
}

section {
  display: flex;
  flex-direction: column;
  gap: var(--gap-panel);
}


/* =============================================
   PANEL
   The notch mask clips everything it covers,
   including shadows, so the drop-shadow lives on
   a wrapper and filters the already-masked child.
   ============================================= */

.panel {
  filter: drop-shadow(0 3px 0 var(--shadow));
}

.panel-inner {
  background: var(--paper);
  padding: var(--pad-panel);

  /* four quadrant tiles, one notch each; 51% so no seam down the middle */
  mask:
    radial-gradient(var(--notch) at 0    0,    #0000 98%, #000) 0    0    / 51% 51% no-repeat,
    radial-gradient(var(--notch) at 100% 0,    #0000 98%, #000) 100% 0    / 51% 51% no-repeat,
    radial-gradient(var(--notch) at 0    100%, #0000 98%, #000) 0    100% / 51% 51% no-repeat,
    radial-gradient(var(--notch) at 100% 100%, #0000 98%, #000) 100% 100% / 51% 51% no-repeat;
}


/* =============================================
   SECTION HEADING
   Uses the same cutout panel as every other
   block, so the label sits on paper rather than
   on the sky, where contrast is unpredictable.
   ============================================= */

.section-head {
  margin: 0;
}

.section-head .panel-inner {
  display: block;
  text-align: center;
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}


/* =============================================
   TEAR LINE
   The notch is a ticket stub, so the rule is a
   perforation.
   ============================================= */

.tear {
  height: 2px;
  border: 0;
  margin: 16px 0;
  background: repeating-linear-gradient(
    to right,
    var(--rule) 0 6px,
    transparent 6px 12px
  );
}


/* =============================================
   MASTHEAD
   ============================================= */

.masthead {
  text-align: center;
}

.masthead h1 {
  margin: 0;
  font-size: var(--t-2xl);
  line-height: var(--lh-tight);
  letter-spacing: 0.01em;
}

.tagline {
  margin: 6px 0 0;
  font-size: var(--t-sm);
  color: var(--ink-muted);
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.section-nav a {
  padding: 4px 0;
  font-size: var(--t-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.section-nav a:hover {
  border-bottom-color: currentColor;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin-top: 12px;
  font-size: var(--t-sm);
}

.contact a {
  padding: 4px 0;
}

.contact span {
  padding: 4px 0;
  color: var(--ink-muted);
}


/* =============================================
   ENTRY  (experience + organizations)
   ============================================= */

/*
   Logos sit inline, left of the whole title block (role, date and org).
   Height-constrained with natural width: these are a mix of wide
   wordmarks (RTX, Linn-Mar) and square marks (ICSSC, Rocket), and a
   fixed square slot would shrink the wordmarks to nothing.
*/
.entry-logo {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.entry-titles {
  flex: 1;
  min-width: 0;
}

.entry-titleline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
}

/* Row spacing lives on the row, not on the <p>, so a margin on one
   flex item can't knock the right-hand column out of alignment. */
.entry-titleline + .entry-titleline {
  margin-top: 6px;
}

.entry-role {
  margin: 0;
  font-size: var(--t-md);
  font-weight: 700;
  line-height: var(--lh-tight);
}

.entry-date {
  /* Pushed right rather than space-between, so it still sits at the far
     edge now that the logo makes this a three-item row. */
  margin-left: auto;
  font-size: var(--t-sm);
  color: var(--ink-muted);
  white-space: nowrap;
}

.entry-org {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--ink-soft);
}

/* Right column, under the date. */
.entry-location {
  margin-left: auto;
  font-size: var(--t-sm);
  color: var(--ink-muted);
  white-space: nowrap;
}

.entry-list {
  margin: 0;
  padding-left: 20px;
  max-width: var(--measure);
}

.entry-list li {
  margin-bottom: 10px;
}

.entry-list li:last-child {
  margin-bottom: 0;
}


/* =============================================
   PROJECT
   ============================================= */

.project-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
}

.project-name {
  margin: 0;
  font-size: var(--t-lg);
  font-weight: 700;
  line-height: var(--lh-tight);
}

.project-link {
  font-size: var(--t-sm);
  white-space: nowrap;
}

.project-stack {
  margin: 6px 0 0;
  font-size: var(--t-sm);
  color: var(--ink-soft);
  font-style: italic;
}

.project-body {
  margin: 0 0 12px;
  max-width: var(--measure);
}

.project-body:last-child {
  margin-bottom: 0;
}


/* =============================================
   MEDIA
   The dot screen echoes the halftone of the sky,
   so screenshots read as printed onto the paper.
   It lifts on hover and focus.
   ============================================= */

.media {
  position: relative;
  margin: 0 0 16px;
  background: var(--ink);
  line-height: 0;
}

.media img,
.media video {
  width: 100%;
  height: auto;
}

.media--screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--ink) 0.5px, #0000 0.6px);
  background-size: 3px 3px;
  opacity: 0.4;
  transition: opacity 0.35s ease;
}

.media--screen:hover::after,
.media--screen:focus-within::after {
  opacity: 0;
}


/* =============================================
   TAGS
   ============================================= */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 3px 9px;
  border: 1px solid var(--rule);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}


/* =============================================
   FOOTER
   ============================================= */

.colophon {
  text-align: center;
}

.colophon p {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--ink-muted);
}

.colophon .contact {
  margin-top: 0;
  margin-bottom: 12px;
}


/* =============================================
   REVEAL
   ============================================= */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}


/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 640px) {
  :root {
    --pad-panel: 20px;
    --notch: 12px;
    --gap-panel: 20px;
    --t-2xl: 1.75rem;
    --t-xl: 1.5rem;
    --t-lg: 1.25rem;
  }

  .entry-logo {
    height: 32px;
  }

  .entry-head {
    align-items: flex-start;
    gap: 12px;
  }

  .entry-titleline .entry-date,
  .entry-titleline .entry-location {
    margin-left: 0;
    flex-basis: 100%;
  }

  .project-head {
    flex-direction: column;
    align-items: flex-start;
  }

}


/* =============================================
   PRINT
   Drops the sky, flattens the paper, and prints
   the thing it came from.
   ============================================= */

@media print {
  .sky,
  .section-nav,
  .media {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.4;
  }

  .page {
    max-width: none;
    padding: 0;
    gap: 12pt;
  }

  main {
    gap: 14pt;
  }

  section {
    gap: 8pt;
  }

  .panel {
    filter: none;
    break-inside: avoid;
  }

  .panel-inner {
    mask: none;
    background: #fff;
    padding: 0;
  }

  .section-head .panel-inner {
    /* Left-aligned in print: a resume reads better with section
       headings on the margin than centred. */
    text-align: left;
    padding-bottom: 2pt;
    border-bottom: 1pt solid #000;
  }

  .entry-logo {
    height: 22px;
  }

  .tear {
    background: none;
    border-top: 0.5pt solid #999;
    height: 0;
    margin: 6pt 0;
  }


  a {
    color: #000;
    text-decoration: none;
  }
}
