/* ==========================================================================
   gortnar.com — site styles
   Colours, fonts and the main gutter live in :root. Change them here.
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --panel: #131313;
  --line: #262626;
  --line-strong: #3a3a3a;
  --text: #ebebeb;
  --text-soft: #cdcdcd;
  --muted: #a3a3a3;
  --faint: #7a7a7a;
  --nav: #d4d4d4;
  --accent: #dd4515;            /* the one orange */
  --thumb-dim: 0.78;            /* thumbnail opacity until hovered (1 = no dimming) */
  --display: 'Syne', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --gutter: 32px;
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }
}

/* ---- base ---------------------------------------------------------------- */

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

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; transition: all 0.65s ease; }
a:hover { color: var(--accent); transition: all 0.2s ease; }

::selection { background: var(--accent); color: var(--bg); }

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

button { font: inherit; color: inherit; cursor: pointer; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---- header -------------------------------------------------------------- */

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--gutter);
}

.logo { display: block; line-height: 0; color: var(--text); }
.logo svg { display: block; width: 35px; height: 40px; }

.nav { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.nav a {
  padding: 12px 4px;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nav);
}
.nav a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .nav { gap: 4px 18px; }
  .nav a { font-size: 13px; }
}

/* ---- hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  background: #000;
  overflow: hidden;
}
.hero--page {
  height: 80vh;
  height: 80svh;
  min-height: 440px;
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10, 10, 10, 0.45), rgba(10, 10, 10, 0) 24%),
    linear-gradient(to top, rgba(10, 10, 10, 0.8), rgba(10, 10, 10, 0.2) 55%);
}

.hero-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0 var(--gutter) 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 4.5vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-sub {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- thumbnails (home tiles + gallery) ------------------------------------ */
/* They sit slightly dimmed and light up on hover. Only on devices that can
   hover; on touch screens they stay at full brightness. */

.ph img,
.shot img {
  display: block;
  width: 100%;
  cursor: pointer;
  transition: opacity 0.35s ease;
}

@media (hover: hover) {
  .ph img,
  .shot img { opacity: var(--thumb-dim); }

  .tile:hover .ph img,
  .tile:focus-visible .ph img,
  .shot:hover img,
  .shot:focus-visible img { opacity: 1; }
}

/* ---- home: work grid ----------------------------------------------------- */

.work {
  padding-top: 96px;
  padding-bottom: 24px;
  container-type: inline-size;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
  gap: 56px 24px;
}

.tile { display: block; min-width: 0; }
.tile--feature { grid-column: 1 / -1; }

.ph {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  aspect-ratio: 16 / 10;
}
.tile--feature .ph { aspect-ratio: 21 / 9; }
.ph img { height: 100%; object-fit: cover; }

.tile:hover .tile-title { color: var(--accent); }

.tile-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-top: 16px;
}
.tile-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.tile-kind { margin-top: 4px; font-size: 13px; color: var(--muted); }
.tile-year { padding-top: 2px; font-size: 13px; color: var(--faint); }

/* The grid is one column below 1064px of content width. Container queries
   measure the grid's own width, so these match its real breakpoint. */

/* One column: the big tile must not be shorter than the small ones. */
@container (max-width: 1063px) {
  .tile--feature .ph { aspect-ratio: 16 / 10; }
}

/* Two columns: the right-hand tile of each row fades in a beat later.
   (children: 1 = the wide tile, 2 = left, 3 = right, 4 = left, 5 = right …) */
@container (min-width: 1064px) {
  .tile:nth-child(2n + 3) { --d: 0.15s; }
}

/* ---- home: about + contact ----------------------------------------------- */

.about {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  padding-top: 120px;
  padding-bottom: 48px;
}
.about-head { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.about h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.prose {
  flex: 2 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-soft);
}
.prose p { margin: 0; }
.prose a { color: var(--text-soft); border-bottom: 2px solid var(--accent); }
.prose a:hover { color: var(--accent); }

.contact {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 72px;
  padding-bottom: 64px;
  border-top: 1px solid var(--line);
}
.contact h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.mail {
  align-self: flex-start;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding-bottom: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 52px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent);
  border-bottom: 3px solid var(--accent);
}
.mail:hover { color: var(--text); }

.pills { display: flex; flex-wrap: wrap; gap: 12px; }
.pill {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

/* ---- project pages ------------------------------------------------------- */

.intro {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  padding-top: 96px;
}
.intro figure {
  flex: 1 1 420px;
  min-width: 0;
  margin: 0;
  aspect-ratio: 16 / 10;
  background: var(--panel);
  overflow: hidden;
}
.intro figure img { display: block; width: 100%; height: 100%; object-fit: cover; }

.tagline {
  flex: 1 1 420px;
  min-width: 0;
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.detail {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  padding-top: 96px;
}
.detail--text-only .prose { max-width: 760px; }

.links {
  flex: 1 1 280px;
  align-self: flex-start;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.links a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.links a:hover { border-bottom-color: var(--accent); }

.video { padding-top: 96px; }
.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.embed--wide { aspect-ratio: 2.35 / 1; }
.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;                      /* space between screenshots */
  align-items: start;
  padding-top: 96px;
}
.shot { display: block; min-width: 0; background: var(--panel); }
.shot--full { grid-column: 1 / -1; }
.shot img { height: auto; }

@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr; }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 24px;
  padding-bottom: 48px;
  font-size: 14px;
  color: var(--faint);
}
.page .site-footer { padding-top: 96px; }
.site-footer .back {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  color: var(--text);
}
.site-footer .back:hover { color: var(--accent); }

/* ---- lightbox ------------------------------------------------------------ */
/* js/site.js adds .visible a moment after opening and removes it before
   closing, which is what makes the fade in and out. How the picture changes
   between images is set by data-effect="slide | fade | flip" on the dialog. */

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: rgba(5, 5, 5, 0.96);
  color: var(--text);
  opacity: 0;
  transition: opacity 0.28s ease;          /* keep in step with T_BOX in site.js */
}
.lightbox.visible { opacity: 1; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }

.lightbox img {
  display: block;
  max-width: calc(100vw - 208px);
  max-height: calc(100vh - 176px);
  max-height: calc(100svh - 176px);
  object-fit: contain;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  transform: scale(0.96);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.lightbox.visible img { transform: none; }

.lb-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(10, 10, 10, 0.7);
  z-index: 9999;
  color: var(--text);
}
.lb-btn:hover { border-color: var(--accent); color: var(--accent); }
.lb-close { top: 24px; right: 24px; }
.lb-prev { left: 24px; top: 50%; margin-top: -28px; }
.lb-next { right: 24px; top: 50%; margin-top: -28px; }

.lb-count {
  position: absolute;
  left: 0; right: 0; bottom: 28px;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

body.lb-open { overflow: hidden; }

@media (max-width: 700px) {
  .lightbox img { max-width: calc(100vw - 24px); max-height: calc(100svh - 160px); }
  .lb-btn { width: 44px; height: 44px; }
  .lb-close { top: 12px; right: 12px; }
  .lb-prev { left: 8px; margin-top: -22px; }
  .lb-next { right: 8px; margin-top: -22px; }
}

/* ---- fade-in on scroll --------------------------------------------------- */
/* Only active when JavaScript is running (html.js), so nothing is ever hidden
   without it. js/site.js adds .in as an element scrolls into view. */

.js .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--d, 0s);
}
.js .reveal.in,
.js.reveal-all .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .tile-title, .ph img, .shot img, .lightbox, .lightbox img { transition: none; }
}
