/* ==========================================================================
   studioindi08.com styles. Direction A: Paper and Ink.
   Mobile first: base rules are for phones, @media blocks add rules for wider screens.
   Colours, fonts and spacing live in the variables below, so most tweaks happen in one place.
   ========================================================================== */

/* Self-hosted fonts (variable weight, Latin characters only). */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --paper: #f6f1e9;
  --paper-2: #ede5d8;
  --ink: #1e1b18;
  --muted: #5e574f;
  --accent: #b5431f;
  --accent-dark: #9a3617;
  --accent-soft: #f3d9cc;
  --rule: #d9d0c2;

  --font-body: "Inter", system-ui, sans-serif;
  --font-head: "Fraunces", Georgia, serif;

  --wrap: 66rem;
  --gutter: 1.25rem;
  --radius: 1rem;
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
}
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}
h1 { font-size: clamp(2.4rem, 8vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.muted { color: var(--muted); }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Skip link: hidden until focused with the keyboard. */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  z-index: 20;
}
.skip-link:focus { left: 0.5rem; }

/* Header and navigation ------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  gap: 0.5rem;
}
.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}
.nav-toggle {
  font: inherit;
  font-weight: 600;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  color: var(--ink);
}
.site-nav { flex-basis: 100%; display: none; }
.site-nav.is-open { display: block; }
.site-nav ul {
  list-style: none;
  margin: 0.75rem 0 0.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.site-nav a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-color: var(--accent); color: var(--ink); }
.site-nav a[aria-current="page"] { border-color: var(--accent); }

@media (min-width: 48rem) {
  .nav-toggle { display: none; }
  .site-nav { display: block; flex-basis: auto; }
  .site-nav ul { flex-direction: row; gap: 1.5rem; margin: 0; }
}

/* Sections -------------------------------------------------------------- */
.section { padding-top: 3rem; padding-bottom: 3rem; border-bottom: 1px solid var(--rule); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.hero { padding-top: 4rem; padding-bottom: 3rem; border-bottom: 1px solid var(--rule); }
.hero h1 { font-size: clamp(3rem, 11vw, 6.5rem); }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { max-width: 34rem; font-size: 1.2rem; color: var(--muted); }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); color: #fff; }

/* Numbered project list ------------------------------------------------- */
.projects { list-style: none; margin: 0; padding: 0; }
.projects li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}
.projects li:last-child { border-bottom: 1px solid var(--rule); }
.projects .num { font-family: var(--font-head); color: var(--accent); font-size: 1.5rem; line-height: 1.2; }
.projects h3 a { color: var(--ink); text-decoration: none; }
.projects h3 a:hover { color: var(--accent); }
.projects p { margin: 0; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--paper-2);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-top: 0.5rem;
  color: var(--ink);
}

/* Post teaser ----------------------------------------------------------- */
.post-teaser { max-width: 40rem; }
.post-teaser time { color: var(--muted); font-size: 0.9rem; display: block; }
.post-teaser h3 { font-size: 1.8rem; }

/* Sign-up box ----------------------------------------------------------- */
.signup {
  background: var(--accent-soft);
  padding: 1.75rem;
  border-radius: var(--radius);
  margin: 3rem 0;
}
.signup h2 { font-size: 2rem; }
.signup p:last-child { margin-bottom: 0; }
@media (min-width: 48rem) { .signup { padding: 2.5rem; } }

/* Plain content pages --------------------------------------------------- */
.page { padding-top: 3rem; padding-bottom: 3rem; max-width: 42rem; }
.page h1 { margin-bottom: 1.5rem; }
.placeholder {
  border: 2px dashed var(--rule);
  border-radius: var(--radius);
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

/* Italian Entry page (code wall) ---------------------------------------- */
.code-form { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.code-form label { flex-basis: 100%; font-weight: 600; }
.code-form input {
  flex: 1 1 14rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--muted);
  border-radius: 999px;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #fff;
  color: var(--ink);
}
.status { min-height: 1.5rem; font-weight: 600; }
.status.error { color: #9a2a12; }
.viewer iframe {
  width: 100%;
  height: min(80vh, 60rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
}
.viewer .actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1rem; }

/* Footer ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }
.site-footer p { margin: 0; }

/* Respect users who turn off animation. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Several files on the Italian Entry page. */
.viewer .file { margin-bottom: 2.5rem; }
.viewer .file h2 { font-size: 1.6rem; }
