/* ============================================================
   PORTFOLIO — shared styles
   Change colours and fonts here later to restyle the whole site.
   ============================================================ */

:root {
  /* [EDIT COLOURS HERE] */
  --paper: #f3eee6;
  --paper-deep: #e7dfd2;
  --ink: #1c1915;
  --ink-soft: #4a433a;
  --ink-faint: rgba(28, 25, 21, 0.12);
  --accent: #6e4a3a;
  --placeholder: #d9d0c3;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;

  --space: clamp(1.25rem, 4vw, 2.5rem);
  --max: 72rem;
  --header-h: 4.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.6;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ---------- Header & hamburger ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--space);
  pointer-events: none;
}

.site-header a,
.site-header button {
  pointer-events: auto;
}

.site-name {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  opacity: 0;
  animation: fadeIn 1.2s ease 1.1s forwards;
}

.page:not(.home) .site-name {
  opacity: 1;
  animation: none;
}

.menu-toggle {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  opacity: 0;
  animation: fadeIn 1.2s ease 1.1s forwards;
}

.page:not(.home) .menu-toggle {
  opacity: 1;
  animation: none;
}

.menu-toggle:hover,
.menu-toggle:focus-visible,
.menu-toggle:active {
  background: var(--ink-faint);
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 1.15rem;
  height: 1.5px;
  background: var(--ink);
  position: relative;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

body.nav-open .menu-toggle span {
  background: transparent;
}

body.nav-open .menu-toggle span::before {
  top: 0;
  transform: rotate(45deg);
}

body.nav-open .menu-toggle span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Home header stays readable on the dark ink, then on the warm hero */
.page.home .site-name {
  color: #f6f1e8;
  text-shadow: 0 1px 12px rgba(22, 19, 16, 0.45);
}

.page.home .menu-toggle span,
.page.home .menu-toggle span::before,
.page.home .menu-toggle span::after {
  background: #f6f1e8;
}

body.nav-open.home .site-name {
  color: var(--ink);
  text-shadow: none;
}

body.nav-open.home .menu-toggle span {
  background: transparent;
}

body.nav-open.home .menu-toggle span::before,
body.nav-open.home .menu-toggle span::after {
  background: var(--ink);
}

/* ---------- Navigation panel ---------- */

.nav-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

body.nav-open .nav-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
}

.nav-list a {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  padding: 0.15em 0.2em;
}

.nav-list a:hover,
.nav-list a:focus-visible,
.nav-list a:active,
.nav-list a[aria-current="page"] {
  font-style: italic;
  color: var(--accent);
}

.nav-list .nav-soon a {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  opacity: 0.55;
  margin-top: 1.5rem;
}

/* ---------- Home / ink hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--paper-deep);
}

/* [REPLACE HERO IMAGE]
   Put your file in assets/images/hero.jpg
   Then add this inside .hero-media:
   <img src="assets/images/hero.jpg" alt="[DESCRIBE HERO IMAGE]">
*/
.hero-media {
  position: absolute;
  inset: 0;
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 30% 40%, #cfc4b4 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, #b9a894 0%, transparent 45%),
    linear-gradient(160deg, #e8dfd1, #c9bba8);
}

.hero-label {
  position: absolute;
  bottom: 1.5rem;
  left: var(--space);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  z-index: 2;
}

.ink-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: #161310;
}

.ink-blot {
  position: absolute;
  border-radius: 46% 54% 48% 52%;
  background: radial-gradient(circle, #120f0c 0%, #120f0c 42%, transparent 70%);
  transform: scale(0.12);
  opacity: 0.95;
  animation: blotSpread 2.6s ease-out forwards;
  will-change: transform, opacity;
}

.ink-blot:nth-child(1) {
  width: 85vw;
  height: 85vw;
  top: 8%;
  left: -10%;
  animation-delay: 0.05s;
}

.ink-blot:nth-child(2) {
  width: 70vw;
  height: 70vw;
  top: 30%;
  right: -15%;
  animation-delay: 0.18s;
}

.ink-blot:nth-child(3) {
  width: 55vw;
  height: 55vw;
  bottom: -5%;
  left: 25%;
  animation-delay: 0.32s;
}

.ink-veil {
  position: absolute;
  inset: 0;
  background: #161310;
  animation: veilLift 2.8s ease 0.35s forwards;
}

@keyframes blotSpread {
  0% {
    transform: scale(0.08);
    opacity: 1;
  }
  55% {
    opacity: 1;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes veilLift {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ink-blot {
    animation: none;
    opacity: 0;
  }

  .ink-veil {
    animation: fadeIn 0.8s ease reverse forwards;
  }

  .site-name,
  .menu-toggle {
    animation: none;
    opacity: 1;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Temporary home reveal */
.hero_media.simple-reveal{
opacity:0;
transform:translateY(18px);
transform:simpleReveal 1.8s ease-out forwards:
}

.hero-media.simple-reveal img{
width:100%;
height:100%;
object-fit:cover;
display:block;
}

@keyframes simpleReveal{
from{
opacity:0;
transform:translateY(18px);
}

to{
opacity:1;
transform:translateY(0);
}
}


/* ---------- Page layout ---------- */

.page-main {
  padding: calc(var(--header-h) + 1.5rem) var(--space) 4rem;
  max-width: var(--max);
  margin: 0 auto;
}

.page-main.wide {
  max-width: 92rem;
}

.page-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 500;
  line-height: 1.05;
  margin: 0 0 1.5rem;
}

.lede {
  max-width: 38rem;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
}

/* ---------- Placeholders ---------- */

.placeholder-block {
  background: var(--placeholder);
  border: 1px dashed rgba(28, 25, 21, 0.28);
  min-height: 12rem;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.placeholder-block.tall {
  min-height: 22rem;
}

.placeholder-block.video {
  min-height: 16rem;
  aspect-ratio: 16 / 9;
}

.editable-note {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- Intro flexible grid ---------- */

.intro-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .intro-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

.intro-text,
.intro-media {
  display: grid;
  gap: 1rem;
}

/* ---------- Category tabs (illustration / animation) ---------- */

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 2rem;
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 0.75rem;
}

.category-nav a {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.35rem;
  opacity: 0.45;
}

.category-nav a:hover,
.category-nav a:focus-visible,
.category-nav a:active,
.category-nav a.is-active {
  opacity: 1;
  font-style: italic;
}

.category-block {
  scroll-margin-top: calc(var(--header-h) + 1rem);
  margin-bottom: 3.5rem;
}

.category-block h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.8rem;
  margin: 0 0 1.25rem;
}

/* ---------- Cards (blog, illustration, animation) ---------- */

.card-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.work-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.work-card .placeholder-block {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.work-card:hover .placeholder-block,
.work-card:focus-visible .placeholder-block,
.work-card:active .placeholder-block {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(28, 25, 21, 0.08);
}

.work-card h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  margin: 0.85rem 0 0.25rem;
}

.work-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.add-hint {
  border: 1px dashed rgba(28, 25, 21, 0.28);
  padding: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- Project / post pages ---------- */

.project-meta {
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

.media-stack {
  display: grid;
  gap: 1.25rem;
  margin: 2rem 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ---------- Footer / contact ---------- */

.site-footer {
  border-top: 1px solid var(--ink-faint);
  padding: 2.5rem var(--space) 3rem;
  max-width: var(--max);
  margin: 0 auto;
}

.site-footer h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  margin: 0 0 1rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.contact-list a[href="#"] {
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

.privacy-note {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Illustration photo wall ---------- */

.photo-wall {
  column-count: 2;
  column-gap: 0.75rem;
}

@media (min-width: 800px) {
  .photo-wall {
    column-count: 3;
  }
}

@media (min-width: 1180px) {
  .photo-wall {
    column-count: 4;
  }
}

.photo-wall > * {
  break-inside: avoid;
  margin: 0 0 0.75rem;
  width: 100%;
}

.gallery-item {
  margin: 0 0 0.75rem;
}

.gallery-hit {
  display: block;
  width: 100%;
  border-radius: 2px;
}

.gallery-hit img {
  width: 100%;
  height: auto;
}

.gallery-hit:hover img,
.gallery-hit:focus-visible img,
.gallery-hit:active img,
.gallery-hit:hover .placeholder-block,
.gallery-hit:focus-visible .placeholder-block,
.gallery-hit:active .placeholder-block {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.gallery-placeholder {
  min-height: 0;
  width: 100%;
}

/* ---------- Lightbox ---------- */

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 19, 16, 0.88);
  overflow: auto;
  padding: 5rem var(--space) 2.5rem;
}

.lightbox-inner {
  max-width: 46rem;
  margin: 0 auto;
  color: #f3eee6;
}

.lightbox-media img {
  width: 100%;
  height: auto;
}

.lightbox-copy h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 1.25rem 0 0.5rem;
}

.lightbox-copy .editable-note {
  color: rgba(243, 238, 230, 0.7);
}

.lightbox-close {
  position: fixed;
  top: 0.85rem;
  right: var(--space);
  z-index: 51;
  min-width: 3.2rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  font-size: 0.95rem;
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-close:active {
  background: #fff;
}

/* ---------- Animation film showcase ---------- */

.film-block {
  margin-bottom: 4.5rem;
}

.film-showcase {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "prev view next"
    "cap cap cap";
  gap: 0.85rem 0.4rem;
  align-items: center;
}

.film-viewport {
  grid-area: view;
  overflow: hidden;
  touch-action: pan-y;
}

.film-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  will-change: transform;
}

.film-track.is-shifting {
  transition: transform 0.45s ease;
}

.film-slide {
  flex: 0 0 min(78%, 36rem);
  opacity: 0.38;
  transform: scale(0.94);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.film-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.film-slide.is-prev,
.film-slide.is-next {
  cursor: pointer;
}

.film-slide.is-idle {
  opacity: 0.18;
}

.film-slide video,
.film-slide iframe,
.film-slide img,
.film-slide .placeholder-block {
  width: 100%;
}

.film-slide iframe {
  aspect-ratio: 16 / 9;
  border: 0;
  min-height: 12rem;
}

.film-arrow {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  font-size: 1.2rem;
  background: var(--ink-faint);
}

.film-arrow:hover,
.film-arrow:focus-visible,
.film-arrow:active {
  background: rgba(28, 25, 21, 0.18);
}

.film-arrow:disabled {
  opacity: 0.28;
  cursor: default;
}

.film-showcase [data-film-prev] {
  grid-area: prev;
}

.film-showcase [data-film-next] {
  grid-area: next;
}

.film-caption {
  grid-area: cap;
  max-width: 38rem;
  margin: 0 auto;
  text-align: center;
}

.film-caption h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0.2rem 0 0.35rem;
}

@media (max-width: 640px) {
  .film-showcase {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "view view"
      "prev next"
      "cap cap";
  }

  .film-arrow {
    justify-self: center;
  }
}

/* ---------- Interactive project page ---------- */

.project-section {
  margin: 0 0 2.75rem;
}

.project-section h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0 0 0.8rem;
}

.control-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.game-frame {
  width: 100%;
  min-height: 70vh;
  border: 0;
  background: #111;
}

.mobile-game-note {
  border: 1px dashed rgba(28, 25, 21, 0.28);
  padding: 1.5rem;
  color: var(--ink-soft);
}

.screenshot-wall {
  column-count: 1;
}

@media (min-width: 700px) {
  .screenshot-wall {
    column-count: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .film-track.is-shifting,
  .film-slide {
    transition: none;
  }
}
