/* Sorted Pattern — site styles
   Colors and sizes are taken from the original Cargo site. */

/* ABC Arizona Serif (Dinamo), licensed by Sorted Pattern */
@font-face {
  font-family: "ABC Arizona Serif";
  src: url("../fonts/ABCArizonaSerif-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  /* One warm color everywhere: the cream from the logo */
  --cream: #ffefc9;
  --text: var(--cream);
  --text-soft: var(--cream);
  --accent: var(--cream);
  --rule: rgba(255, 239, 201, 0.25);
  --underline: rgba(255, 239, 201, 0.5);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --serif: "ABC Arizona Serif", Georgia, serif;
  /* Left/right page margin, shared by the header and every page */
  --gutter: 10rem;
}

/* Base size scales with the window, like Cargo did */
html { font-size: clamp(9px, 1.08vw, 17px); }

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.1rem;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; display: flex; flex-direction: column; }
main > * { flex: 1; }

a {
  color: inherit;
  text-decoration: underline 1px var(--underline);
  text-underline-offset: 0.18em;
}
a:active { opacity: 0.7; }
a.plain, a.icon, a.emblem, a.home__enter, a.slideshow__slide { text-decoration: none; }

hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 0.6rem 0;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2 { margin: 0; padding: 0; font-weight: 400; }

/* ---------- Scrolling SORTED / PATTERN bands ---------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  font-size: 1.1rem;
  line-height: 1.3;
  padding: 0.275rem 0;
  color: var(--text);
  pointer-events: none;
  user-select: none;
  position: relative;
  z-index: 5;
}
.marquee__track {
  display: inline-flex;
  animation: marquee var(--marquee-speed, 60s) linear infinite;
}
.marquee__track span { padding-right: 0.6ch; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/* SORTED and PATTERN stay pinned to the top and bottom of the window, with
   no background, on every page */
.marquee--top { position: fixed; top: 0; left: 0; right: 0; }
.marquee--bottom { position: fixed; bottom: 0; left: 0; right: 0; }
body { padding-bottom: 2rem; }
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* ---------- Site header (same on every page) ---------- */
.site-nav {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 2rem;
  padding: 4.4rem var(--gutter) 0;
  font-size: 1.7rem;
  line-height: 1.8;
}
.site-nav a { color: var(--accent); }

/* ---------- Home ---------- */
.home {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--gutter);
}
.home__content { position: relative; z-index: 2; width: 100%; }
.home__logo { display: inline-block; }
/* The whole homepage is one link to Projects */
.home__enter { position: fixed; inset: 0; z-index: 4; border: 0; cursor: pointer; }
.home__logo img { width: 777px; max-width: 100%; margin: 0 auto; }
.home__tagline {
  font-size: 1rem;
  line-height: 1.4;
  color: var(--cream);
  margin: 0.2rem 0 0;
}

#ripple {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #000 url("../images/imgp0764.jpg") center / cover no-repeat;
}
#ripple canvas { width: 100%; height: 100%; display: block; }

/* ---------- Shared inner-page layout ---------- */
.page {
  width: 100%;
  padding: 0 var(--gutter) 3.1rem;
}
.page > hr:first-child { margin-top: 0.2rem; }

/* ---------- Projects ---------- */
.projects { font-size: 1.2rem; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem 2.4rem;
  margin-top: 2.4rem;
}
.project h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.7rem;
  line-height: 1.25;
  margin-top: 1rem;
}
.project h1 a { color: var(--accent); }
.project__role { margin: 0.5rem 0 0; line-height: 1.3; opacity: 0.75; }
.project-grid .slideshow { background: #0b0b0b; }
.project-grid .slideshow__slide img { object-fit: cover; transition: transform 0.6s ease; }
.project-grid .slideshow:hover .slideshow__slide img { transform: scale(1.03); }
.project-grid .slideshow__btn { width: 3rem; }
.project-grid .slideshow__btn svg { width: 2.2rem; height: 2.2rem; }

/* Slideshow */
.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.slideshow__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
}
.slideshow__slide.is-active { opacity: 1; z-index: 1; }
.slideshow__slide img { width: 100%; height: 100%; object-fit: contain; }
.slideshow__btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4.5rem;
  z-index: 2;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slideshow:hover .slideshow__btn,
.slideshow__btn:focus-visible { opacity: 1; }
.slideshow__btn--prev { left: 0; }
.slideshow__btn--next { right: 0; }
.slideshow__btn svg { width: 3.2rem; height: 3.2rem; }
.slideshow__btn polyline { fill: none; stroke: var(--cream); stroke-width: 1.5; filter: drop-shadow(0 0 2px rgba(0,0,0,.6)); }
@media (hover: none) { .slideshow__btn { opacity: 0.8; } }

.contact-icons { display: flex; gap: 0.9em; margin-top: 3rem; font-size: 2.8rem; }
.contact-icons a { color: var(--accent); display: inline-flex; }
.contact-icons svg { width: 1em; height: 1em; }

/* ---------- About ---------- */
.about { font-size: 1rem; line-height: 2; color: var(--text-soft); }
.about .split {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
}
.about .emblem { display: block; border: 0; margin: 5rem 0 3rem; }
.about .emblem img { width: 100%; }
.about .row {
  display: grid;
  grid-template-columns: 3fr 9fr;
  gap: 0 4rem;
  margin-bottom: 1.5rem;
}
.about .label { margin-top: 1rem; }
/* Logos are trimmed to their visible edges. Each one's width (--w, a share
   of its cell) is set by eye so they all look the same size. */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem 2rem;
  margin: 2rem 0 3.5rem;
}
.logo-grid div {
  aspect-ratio: 5 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-grid img { width: calc(var(--w, 0.6) * 100%); height: auto; }
.about .contact-icons { margin-top: 1.2rem; }

/* ---------- Video lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vw;
}
.lightbox.is-open { display: flex; }
.lightbox__frame { width: min(100%, 160vh); aspect-ratio: 16 / 9; }
.lightbox__frame iframe { width: 100%; height: 100%; border: 0; }
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: 0;
  color: var(--cream);
  font: 300 3rem/1 var(--mono);
  cursor: pointer;
}



/* ---------- Phones ---------- */
@media (max-width: 700px) {
  html { font-size: 10px; }
  :root { --gutter: 1.6rem; }
  .site-nav { font-size: 1.4rem; padding-top: 4rem; }
  .home { padding: 4rem var(--gutter); }
  .about .row { grid-template-columns: 1fr; gap: 0; }
  .logo-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 2.4rem; }
  .project-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem 1.6rem; }
  .project h1 { font-size: 1.7rem; }
}
