/* NewPlace2Frown — field journal stylesheet
   Plan 01 reference implementation.
   Direction: monochrome, type-led, single-column, sidebar + main panel. */

:root {
  --sidebar-width: 240px;
  --bg: #ffffff;
  --ink: #111111;
  --ink-soft: #555555;
  --rule: #e6e6e6;
  --accent: #7a2c1c; /* burnt red for hover; revisit at next visual checkpoint */

  --serif: 'EB Garamond', Garamond, 'Iowan Old Style', Georgia, serif;
  --sans:  'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, Menlo, 'JetBrains Mono', monospace;

  --measure: 64ch;
  --gap: 1.5rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Layout shell ---- */

.layout-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 32px;
  z-index: 30;
}

.main {
  margin-left: var(--sidebar-width);
  padding: 56px 64px 96px;
}

/* ---- Logo (typeset wordmark) ---- */

.sidebar .logo {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0;
  /* enough vertical room to host the four stacked lines including the offset shadow */
  min-height: 130px;
}
.logo-wordmark {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0;
  font-family: 'Bowlby One', 'Arial Black', sans-serif;
  font-weight: 400; /* Bowlby is single-weight; 400 is the only available cut */
  font-size: 2rem;
  line-height: 0.95;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--rule);
  /* Faux extra weight to push Bowlby toward Rig Solid's heavier silhouette.
     -webkit-text-stroke is non-standard but supported in all modern browsers. */
  -webkit-text-stroke: 0.6px var(--ink);
}
.logo-line {
  display: block;
  /* hidden until the reveal animation flags the line */
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 180ms ease, transform 180ms ease, letter-spacing 240ms ease;
}
.logo-line.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.logo-numeral {
  /* II tucked just under the E of PLACE, not flung out right */
  padding-left: 1.6em;
  font-size: 0.78em;
  letter-spacing: 0.08em;
  /* No extra stroke on II — keep it as a marker, not a line of letters */
  -webkit-text-stroke: 0;
}
.logo-frown {
  /* FROWN gets the rotating animation; transitions handled by JS-set styles */
  transition: letter-spacing 240ms ease, font-family 0ms;
}
/* Alternate faces for FROWN's cycle. CSS transitions on letter-spacing
   give the smooth pulse; font-family swaps are abrupt by design. */
.logo-frown[data-alt="inter"] {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-weight: 800;
  -webkit-text-stroke: 0;
}
.logo-frown[data-alt="serif"] {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  -webkit-text-stroke: 0;
}
.logo-frown[data-alt="serif-up"] {
  font-family: var(--serif);
  font-weight: 500;
  font-style: normal;
  -webkit-text-stroke: 0;
}

/* Visually hidden but still announced by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Nav ---- */

.sidebar .nav {
  flex: 1;
}
.sidebar .nav ul,
.socials {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar .nav li { margin: 0; }
.sidebar .nav a,
.socials a {
  display: inline-block;
  padding: 6px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  position: relative;
}
.sidebar .nav a::after,
.socials a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transition: right 200ms ease;
}
.sidebar .nav a:hover,
.sidebar .nav a:focus-visible,
.socials a:hover,
.socials a:focus-visible {
  color: var(--accent);
  outline: none;
}
.sidebar .nav a:hover::after,
.sidebar .nav a:focus-visible::after,
.socials a:hover::after,
.socials a:focus-visible::after {
  right: 0;
}
.sidebar .nav a.active {
  font-weight: 500;
}
.sidebar .nav a.active::after {
  right: 0;
  background: var(--ink);
}

/* ---- Socials at bottom ---- */

.socials {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.socials a { color: var(--ink-soft); }

/* ---- Type ---- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.main h1 {
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}
.main h2 {
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 2.5rem 0 0.75rem;
}
.main p {
  max-width: var(--measure);
  margin: 0 0 1.1em;
}
.main a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 200ms ease;
}
.main a:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

/* ---- Project page primitives (used by project.njk) ---- */

.project-header {
  margin-bottom: 2.5rem;
}
.project-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 1rem 0 0;
}
.project-meta span strong {
  color: var(--ink);
  font-weight: 500;
  margin-right: 0.5em;
}
.project-intro {
  margin: 1.75rem 0 3rem;
}
.project-images {
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.project-images figure {
  margin: 0;
}
.project-images img {
  width: 100%;
  height: auto;
  display: block;
}
.project-images figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- Mobile ---- */

.mobile-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 6px 11px;
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 25;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-110%);
    transition: transform 240ms ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 80px 22px 64px; }
  .mobile-toggle { display: block; }
}

/* ---- Generic content pages (about, contact) ---- */

.page-header {
  margin-bottom: 2.5rem;
}
.page-header h1 {
  margin-bottom: 0.25rem;
}
.page-subtitle {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
}
.page-body p {
  max-width: var(--measure);
}
.page-body figure {
  margin: 2rem 0;
}
.page-body figure img {
  width: 100%;
  height: auto;
  display: block;
}
.page-body figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- Projects index ---- */

.projects-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 32px;
}
.projects-index a {
  display: block;
  text-decoration: none;
  color: var(--ink);
}
.projects-index figure {
  margin: 0 0 0.75rem;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.projects-index figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 200ms ease;
}
.projects-index a:hover figure img { opacity: 0.92; }
.project-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.project-card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
}
.project-card-year {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

/* ---- Work (curated highlight reel) ---- */

.work-images {
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.work-images figure { margin: 0; }
.work-images img { width: 100%; height: auto; display: block; }
.work-images figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- Journal ---- */

.journal-index {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.journal-index li {
  border-bottom: 1px solid var(--rule);
}
.journal-index a {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  padding: 14px 0;
  text-decoration: none;
  color: var(--ink);
}
.journal-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  flex: 0 0 110px;
}
.journal-title {
  font-family: var(--serif);
  font-size: 1.1rem;
}
.journal-index a:hover .journal-title { color: var(--accent); }

.journal-rss {
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.journal-rss a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 200ms ease, border-color 200ms ease;
}
.journal-rss a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.journal-post .page-body {
  max-width: var(--measure);
}

/* ---- Post: bilingual statements (EN / CY side-by-side, stack on mobile) ---- */

.post-toc {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.5rem 0 2.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
}
.post-toc ol { margin: 0; padding-left: 1.25rem; }
.post-toc li { margin: 4px 0; }

.bilingual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 2rem;
  margin: 1rem 0 2.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}
.bilingual .english,
.bilingual .welsh {
  min-width: 0;
}
.bilingual .welsh {
  color: var(--ink-soft);
  border-top: 1px dashed var(--rule);
  padding-top: 1rem;
}
@media (min-width: 900px) {
  .bilingual {
    grid-template-columns: 1fr 1fr;
  }
  .bilingual .welsh {
    border-top: none;
    border-left: 1px dashed var(--rule);
    padding-top: 0;
    padding-left: 1.5rem;
  }
}
.bilingual p { max-width: none; }

/* ---- Home (hero rotator + overlay + latest block) ---- */

.home {
  /* main panel padding is set by .main; we let the hero break out of the padded column */
  margin: -56px -64px 0;
}

.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - 0px);
  margin: 0;
  background: var(--ink);
  overflow: hidden;
}
.hero-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1500ms ease-in-out;
}
.hero-frame.is-active { opacity: 1; }
.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-frame figcaption {
  position: absolute;
  left: 22px;
  bottom: 18px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 56px;
  padding: 0 48px;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 14px rgba(0,0,0,0.55);
  font-family: var(--serif);
  z-index: 2;
}
.home-byline {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 0.4em;
  max-width: 28ch;
  opacity: 0;
  animation: home-fadeup 900ms 600ms ease-out forwards;
}
.home-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
  opacity: 0;
  animation: home-fadeup 900ms 1100ms ease-out forwards;
}
@keyframes home-fadeup {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.latest {
  margin: 56px 64px 0;
  border-top: 1px solid var(--rule);
  padding: 24px 0 0;
}
.latest-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 6px;
}
.latest-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--ink);
}
.latest-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.latest-link:hover { color: var(--accent); }

@media (max-width: 900px) {
  .home { margin: -80px -22px 0; }
  .home-overlay { padding: 0 22px; bottom: 36px; }
  .home-byline { font-size: 1.2rem; max-width: 22ch; }
  .latest { margin: 40px 22px 0; }
}

/* ---- Sidebar disclosure (hierarchical Projects) ---- */

.nav-folder {
  margin: 0;
}
.nav-folder > summary {
  list-style: none;
  cursor: pointer;
  padding: 0;
  display: block;
}
.nav-folder > summary::-webkit-details-marker { display: none; }
.nav-folder > summary > a { padding-right: 1rem; }
.nav-folder > summary::after {
  content: "+";
  float: right;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 6px;
  transition: transform 200ms ease;
  display: inline-block;
}
.nav-folder[open] > summary::after { content: "−"; }
.sidebar .nav .nav-folder > ul {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0 0 0 22px;
}
.sidebar .nav .nav-folder > ul > li > a {
  display: inline-block;
  padding: 3px 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  letter-spacing: 0.005em;
}
.sidebar .nav .nav-folder > ul > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 1px;
  height: 1px;
  background: currentColor;
  transition: right 200ms ease;
}
.sidebar .nav .nav-folder > ul > li > a:hover,
.sidebar .nav .nav-folder > ul > li > a:focus-visible { color: var(--accent); }
.sidebar .nav .nav-folder > ul > li > a:hover::after,
.sidebar .nav .nav-folder > ul > li > a:focus-visible::after { right: 0; }
.sidebar .nav .nav-folder > ul > li > a.active {
  color: var(--ink);
  font-weight: 500;
}
.sidebar .nav .nav-folder > ul > li > a.active::after { right: 0; background: var(--ink); }

/* ---- Specimen card (Bestiary-flavour project header) ---- */

.specimen {
  display: grid;
  border: 1px solid var(--ink);
  margin: 0 0 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  max-width: 560px;
}
.specimen-row {
  display: grid;
  grid-template-columns: max-content 1fr 12px max-content 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--rule);
}
.specimen-row:first-child { border-top: none; }
.specimen-label {
  color: var(--ink-soft);
}
.specimen-value {
  color: var(--ink);
}
.specimen-spacer { background: var(--ink); height: 100%; min-height: 12px; }

/* ---- Project image frame numbers ---- */

.project-images figcaption {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}
.project-images figcaption .frame-no {
  color: var(--ink-soft);
  font-weight: 500;
}
.project-images figcaption .frame-caption {
  color: var(--ink);
}

/* ---- Prints page ---- */

.prints-intro {
  max-width: var(--measure);
  margin: 0 0 3rem;
}
.prints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 48px 28px;
}
.print-card a {
  display: block;
  text-decoration: none;
  color: var(--ink);
}
.print-card figure {
  margin: 0 0 0.75rem;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.print-card img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  transition: opacity 200ms ease;
}
.print-card a:hover img { opacity: 0.92; }
.print-card a:hover .print-title { color: var(--accent); }
.print-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 0.3rem;
}
.print-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0;
}
.print-price { color: var(--ink); }
.print-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 2px 7px;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.prints-merch {
  margin-top: 4.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.prints-merch h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
.prints-footer {
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .prints-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 16px; }
}
@media (max-width: 420px) {
  .prints-grid { grid-template-columns: 1fr; }
}

/* ---- Home: prints hook under the hero ---- */

.home-shop-hook {
  margin: 56px 64px 0;
  border-top: 1px solid var(--rule);
  padding: 24px 0 0;
}
.home-shop-hook a {
  font-family: var(--serif);
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--ink);
}
.home-shop-hook a:hover { color: var(--accent); }
.home-shop-hook .latest-label { margin-bottom: 6px; }
@media (max-width: 900px) {
  .home-shop-hook { margin: 40px 22px 0; }
}

/* ---- Email capture (Buttondown embed) ---- */

.email-capture {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}
.email-capture-copy {
  margin: 0.4rem 0 1rem;
  font-family: var(--serif);
  font-size: 1.1rem;
}
.email-capture-form {
  display: flex;
  gap: 8px;
  max-width: 420px;
}
.email-capture-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 0;
}
.email-capture-form input[type="email"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.email-capture-form button {
  padding: 9px 18px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.email-capture-form button:hover,
.email-capture-form button:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  outline: none;
}
@media (max-width: 480px) {
  .email-capture-form { flex-direction: column; }
}

/* Home variant sits in the padded flow below the hero */
.home-email {
  margin: 0 64px;
}
.home-email .email-capture { margin-top: 40px; }
@media (max-width: 900px) {
  .home-email { margin: 0 22px; }
}

/* ---- Dark mode tokens ----
   Toggling is done via [data-theme="dark"] on <html>.
   System preference handled in JS (theme.js) so it can persist user override. */

html[data-theme="dark"] {
  --bg:        #0d0d0d;
  --ink:       #ececec;
  --ink-soft:  #999999;
  --rule:      #2a2a2a;
  --accent:    #d97757; /* warmer in dark — same family as burnt red, lifted */
}

/* Image presentation in dark — slight desaturation/dim avoids retina glare */
html[data-theme="dark"] .project-images img,
html[data-theme="dark"] .work-images img,
html[data-theme="dark"] .hero-frame img {
  filter: brightness(0.92);
  transition: filter 240ms ease;
}

/* Specimen card border uses --ink so it inverts naturally; explicit just in case: */
html[data-theme="dark"] .specimen { border-color: var(--ink); }

/* ---- Theme toggle (minimal sun/moon glyph) ---- */

.theme-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 8px 8px 8px 0;
  margin: 16px 0 4px;
  cursor: pointer;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 0;
  transition: color 200ms ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--accent);
  outline: none;
}
.theme-icon { display: block; }
.theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun  { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: block; }

/* Logo wordmark uses --ink for fill and --ink-soft for the drop shadow,
   so it inverts naturally in dark mode. No filter needed. */
