/* rinji.dev v2 — Bauhaus workshop for ephemeral code
   palette : Bauhaus Black, Workshop Gold, Blueprint Blue,
             Drafting White, Ethereal Lavender, Sharp Graphite, Module Red
   layout  : f-pattern + golden-ratio Bauhaus primaries + sharp-angle cuts
*/

:root {
  --c-black: #0D0D0D;
  --c-gold: #D4A843;
  --c-blue: #2D5E8A;
  --c-white: #E8E4DC;
  --c-lavender: #A8A0C0;
  --c-graphite: #3A3A3A;
  --c-red: #C24D3F;

  --easing-bauhaus: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--c-black); color: var(--c-white); }

body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.75;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ===== Frame & Wireframe ===== */
.frame-svg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  animation: frame-draw 1s 0.6s forwards;
}
@keyframes frame-draw { to { opacity: 1; } }

.wireframe-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.18;
}
.wire-svg { width: 100%; height: 100%; display: block; }

/* ===== Workshop Gate ===== */
.gate {
  position: relative;
  min-height: 100vh;
  padding: 8vh 10vw 6vh;
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto 1fr auto;
  gap: 4rem;
  z-index: 2;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 60px), 0 100%);
  background: linear-gradient(180deg, #0D0D0D 0%, #111 100%);
}

.primaries {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.prim {
  position: absolute;
  opacity: 0;
  animation: prim-fade 0.9s 0.3s forwards;
  transition: transform 0.5s var(--easing-bauhaus);
  pointer-events: auto;
}
@keyframes prim-fade {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.prim-circle {
  width: 180px; height: 180px;
  border: 1.5px solid var(--c-gold);
  border-radius: 50%;
  /* golden ratio: 38.2% from top, 61.8% from left */
  top: 38.2%; left: 61.8%;
  background: radial-gradient(circle, rgba(212,168,67,0.07) 0%, transparent 70%);
}
.prim-circle::after {
  content: "";
  position: absolute; inset: 36%;
  border-radius: 50%;
  background: var(--c-gold);
  opacity: 0.65;
}
.prim-circle:hover { transform: scale(1.05) rotate(5deg); }

.prim-triangle {
  width: 140px; height: 140px;
  top: 12%; left: 8%;
  filter: drop-shadow(0 0 12px rgba(212,168,67,0.25));
}
.prim-triangle svg { width: 100%; height: 100%; }
.prim-triangle:hover { transform: rotate(15deg); }

.prim-square {
  width: 100px; height: 100px;
  background: var(--c-gold);
  bottom: 14%; left: 38.2%;
  opacity: 0.85;
  box-shadow: 0 0 24px rgba(212,168,67,0.2);
}
.prim-square:hover { transform: scale(1.02) rotate(-3deg); opacity: 1; }

/* Wordmark block */
.wordmark-block {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  align-self: center;
  z-index: 3;
  max-width: 720px;
}

.meta-label {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 1.5rem;
  border-left: 2px solid var(--c-gold);
  padding-left: 0.6rem;
}

.wordmark {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: clamp(48px, 9vw, 124px);
  line-height: 1;
  color: var(--c-gold);
  letter-spacing: 0.1em;
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: wordmark-in 0.8s 1s forwards;
}
.wordmark span { display: inline-block; }
.wordmark .w-dot { color: var(--c-white); }
.wordmark .w-dev { color: var(--c-white); font-weight: 400; font-size: 0.55em; vertical-align: 0.4em; margin-left: 0.05em; }
@keyframes wordmark-in {
  from { opacity: 0; letter-spacing: 0.1em; }
  to   { opacity: 1; letter-spacing: -0.01em; }
}

.tagline {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--c-white);
  max-width: 600px;
  opacity: 0;
  animation: fade-in 0.8s 1.6s forwards;
}
.tagline em { color: var(--c-lavender); font-style: italic; }
@keyframes fade-in { to { opacity: 1; } }

.gate-modules {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  align-self: center;
  z-index: 3;
  opacity: 0;
  animation: fade-in 0.8s 1.4s forwards;
}
.module-svg { width: 100%; height: auto; max-width: 240px; }
.module-svg line, .module-svg circle, .module-svg rect, .module-svg polygon {
  transition: stroke 0.3s ease;
}
.gate-modules:hover svg circle,
.gate-modules:hover svg rect,
.gate-modules:hover svg polygon { stroke: var(--c-gold); }

.gate-coordinates {
  grid-column: 1 / -1;
  grid-row: 3 / 4;
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--c-graphite);
  text-transform: uppercase;
  border-top: 0.5px solid var(--c-graphite);
  padding-top: 1rem;
  z-index: 3;
}
.gate-coordinates span { color: var(--c-lavender); }

/* ===== Documentation Flow (F-Pattern) ===== */
.docflow {
  position: relative;
  padding: 10vh 0;
  background: var(--c-black);
  z-index: 2;
}

.docflow-inner {
  max-width: 800px;
  margin-left: 10vw;
}

.doc-section {
  position: relative;
  padding: 4rem 0;
  border-bottom: 0.5px dashed var(--c-graphite);
}
.doc-section:last-child { border-bottom: none; }

.doc-index {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 1rem;
}

.doc-headline {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--c-white);
  margin-bottom: 1.6rem;
  max-width: 720px;
}

.doc-body {
  max-width: 600px;
  color: var(--c-white);
  margin-bottom: 1.4rem;
}
.doc-body em {
  color: var(--c-lavender);
  font-style: italic;
}

.doc-code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  background: rgba(58, 58, 58, 0.3);
  border-left: 2px solid var(--c-gold);
  padding: 1rem 1.2rem;
  max-width: 600px;
  color: var(--c-white);
  margin-top: 1.2rem;
  overflow-x: auto;
}
.doc-code code { white-space: pre; }

.doc-margin {
  position: absolute;
  right: -120px;
  top: 4rem;
  width: 120px;
  height: 120px;
  opacity: 0.85;
  transition: transform 0.4s var(--easing-bauhaus);
}
.doc-margin svg { width: 100%; height: 100%; }
.doc-section:hover .doc-margin { transform: rotate(8deg) scale(1.05); }

@media (max-width: 1100px) {
  .doc-margin { display: none; }
  .docflow-inner { margin: 0 6vw; }
}

/* ===== Module Showcase ===== */
.showcase {
  position: relative;
  padding: 12vh 10vw;
  background: linear-gradient(180deg, #0D0D0D 0%, #131313 100%);
  z-index: 2;
  clip-path: polygon(0 40px, 100% 0, 100% calc(100% - 60px), 0 100%);
}

.showcase-head {
  max-width: 800px;
  margin-bottom: 4rem;
}
.showcase-title {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--c-white);
  margin-top: 1rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.module {
  position: relative;
  padding: 2rem 1.6rem;
  background: rgba(58, 58, 58, 0.18);
  border: 0.5px solid var(--c-graphite);
  cursor: pointer;
  outline: none;
  transition: transform 0.4s var(--easing-bauhaus),
              border-color 0.3s ease,
              background 0.3s ease;
}
.module:hover, .module:focus {
  border-color: var(--c-gold);
  background: rgba(212, 168, 67, 0.05);
  transform: translateY(-4px);
}
.module:focus { box-shadow: 0 0 0 1px var(--c-gold); }

.module-shape {
  width: 96px;
  height: 96px;
  margin-bottom: 1.4rem;
  transition: transform 0.4s var(--easing-bauhaus);
}
.module-shape svg { width: 100%; height: 100%; }

.module-circle:hover .module-shape { transform: scale(1.05) rotate(5deg); }
.module-triangle:hover .module-shape { transform: rotate(15deg); }
.module-square:hover .module-shape { transform: scale(1.02) rotate(-3deg); }

.module-name {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--c-gold);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}
.module-desc {
  font-size: 15px;
  color: var(--c-white);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}
.module-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-lavender);
  display: block;
  border-top: 0.5px solid var(--c-graphite);
  padding-top: 0.8rem;
}

/* ===== Blueprint Footer ===== */
.blueprint-foot {
  position: relative;
  padding: 6vh 10vw 4vh;
  background: var(--c-black);
  border-top: 0.5px solid var(--c-graphite);
  z-index: 2;
}
.foot-wire { margin-bottom: 3rem; opacity: 0.55; }
.foot-wire svg { width: 100%; height: auto; max-height: 160px; }

.foot-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.foot-col p {
  font-size: 14px;
  color: var(--c-white);
  margin-top: 0.8rem;
  line-height: 1.6;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .gate {
    grid-template-columns: 1fr;
    padding: 6vh 6vw 4vh;
  }
  .gate-modules {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    margin-top: 2rem;
  }
  .gate-coordinates {
    grid-row: 4 / 5;
  }
  .prim-circle { width: 110px; height: 110px; }
  .prim-triangle { width: 90px; height: 90px; }
  .prim-square { width: 70px; height: 70px; }

  .docflow-inner { margin: 0 6vw; }
  .showcase { padding: 8vh 6vw; }
  .blueprint-foot { padding: 5vh 6vw 3vh; }
}
