@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg: #ffffff;
  --ink: #0d0d0c;
  --muted: #6b675c;
  --accent: #4f6a38;
  --line: rgba(13, 13, 12, 0.18);
  --frame-margin: 10px;

  --font-mono: 'Space Mono', 'Courier New', monospace;
  --gutter: clamp(20px, 4vw, 32px);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #f4f3ee;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

a { color: inherit; }

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

/* Bordered frame — Concept D's signature: a thin margin + border around the whole page */
.frame {
  margin: var(--frame-margin);
  min-height: calc(100vh - (var(--frame-margin) * 2));
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* Site header — logo left, Work/About/Contact nav right, no coordinate readout */
.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px var(--gutter) 18px;
  border-bottom: 1px solid var(--line);
}

.logo {
  text-decoration: none;
  color: inherit;
  line-height: 1.35;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.logo span { display: block; }

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 28px);
  padding-top: 2px;
}

.site-nav a {
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.55;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  opacity: 1;
  color: var(--accent);
}

/* Shared page shell for content pages (about, contact, work, projects) */
.page {
  max-width: 1100px;
  padding: 44px var(--gutter) 80px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 32px;
  letter-spacing: 0.04em;
}
.eyebrow .bracket { color: var(--accent); }

.page-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 28px;
  line-height: 1.15;
}

.prose {
  max-width: 68ch;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  line-height: 1.85;
}
.prose p { margin: 0 0 1.4em; }

.back-link {
  display: inline-block;
  font-size: 11px;
  text-decoration: none;
  color: var(--muted);
}
.back-link:hover { color: var(--accent); }

/* About page — bio, person block, CV-style award list */
.section-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 56px 0 18px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.person-block {
  margin: 40px 0 8px;
  text-transform: none;
  letter-spacing: 0;
}
.person-block .name { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.person-block .role { font-size: 13px; color: var(--muted); line-height: 1.6; }

.cv-list { max-width: 72ch; }
.cv-row {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.6;
}
.cv-row .yr { color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; padding-top: 1px; }

@media (max-width: 560px) {
  .cv-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Meta rows — label : value, used in project panels and pages */
.meta-list { border-top: 1px solid var(--line); max-width: 40em; }
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.meta-row dt { color: var(--muted); margin: 0; }
.meta-row dd { margin: 0; text-align: right; }

/* Footer */
.site-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  padding: 16px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-header { padding: 16px 20px 14px; }
  .site-footer { padding: 14px 20px; flex-direction: column; gap: 6px; }
}

/* ---------------------------------------------------------------
   Work page — accordion project index
   --------------------------------------------------------------- */
.proj-item { border-bottom: 1px solid var(--line); }

.proj-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 22px var(--gutter);
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.proj-item > summary::-webkit-details-marker { display: none; }
.proj-item > summary::after {
  content: "+";
  font-size: 20px;
  color: var(--muted);
  font-weight: 400;
}
.proj-item[open] > summary::after { content: "\2212"; color: var(--accent); }
.proj-item > summary:hover { color: var(--accent); }

.proj-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 0 var(--gutter) 40px;
}

.proj-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ece9e0;
}
.proj-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-media.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
}

.proj-info h3 { display: none; } /* name already shown as the summary headline */
.proj-info .view-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
}
.proj-info .view-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .proj-panel { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------
   Project detail page — text left, image(s) right (stacks under 860px)
   Header + back row stay fixed at top, footer fixed at bottom, only the
   text/image column in between scrolls (see .project-frame/.project-scroll).
   --------------------------------------------------------------- */
.project-frame {
  height: calc(100vh - (var(--frame-margin) * 2));
  overflow: hidden;
}

.project-head { flex-shrink: 0; }

.back-row {
  padding: 22px var(--gutter) 20px;
  border-bottom: 1px solid var(--line);
}

.project-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.project-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
}

.project-text {
  padding: 40px var(--gutter) 60px;
}
.project-text h1 {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 6px;
  line-height: 1.1;
}
.project-text .subtitle {
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 28px;
}

.project-desc {
  margin-top: 32px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  line-height: 1.85;
  max-width: 56ch;
}
.project-desc p { margin: 0 0 1.3em; }
.project-desc a { color: var(--accent); }

.project-media {
  padding: 40px var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.project-media img { width: 100%; display: block; }
.project-media .placeholder {
  aspect-ratio: 4/3;
  background: #ece9e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .project-layout { grid-template-columns: 1fr; }
  .project-text { border-bottom: 1px solid var(--line); }
}

/* ---------------------------------------------------------------
   Work/start page — hero stage + glyph canvas
   --------------------------------------------------------------- */
.work-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px var(--gutter);
}

.hero-frame {
  position: relative;
  width: min(46vw, 460px);
  cursor: none;
}

/* Photo is rotated 90° clockwise (see content-source.md) so its aspect
   exactly matches the pre-rendered video's 3:4 portrait crop — both can use
   object-fit:cover edge-to-edge with no letterboxing and no cropping. */
.hero-frame .media-box {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--bg);
}

.hero-frame img,
.hero-frame .hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease;
}

.ladybug-web-pack-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media { opacity: 0; }
.hero-frame.is-hover .hero-media { opacity: 1; }
.hero-frame.is-hover .hero-source { opacity: 0; }

.hero-cursor {
  position: fixed;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 7px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.2s ease;
}
.hero-cursor.is-visible { opacity: 1; }

#glyph-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#glyph-canvas.is-active { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .hero-frame, .hero-frame img, .hero-frame .hero-media, #glyph-canvas {
    transition: none !important;
  }
}

/* ---------------------------------------------------------------
   Contact page
   --------------------------------------------------------------- */
.contact-cta {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.contact-cta:hover { color: var(--accent); border-color: var(--accent); }
.contact-cta .arrow { font-size: 0.7em; color: var(--muted); }

.contact-meta {
  margin-top: 40px;
  font-size: 12px;
  color: var(--muted);
  line-height: 2;
}
