/* continua.club — Goblincore Opulence Cabinet */
/* Design: dark earth backgrounds, jewel-tone accents, collage imagery, card-flip interaction */

:root {
  --peat-black: #1a1209;
  --dark-umber: #2a1f14;
  --aged-walnut: #3d2e1f;
  --deep-ruby: #8b2252;
  --forest-emerald: #1a6b4a;
  --antique-gold: #c4952a;
  --amethyst-dusk: #4a3080;
  --parchment: #e8dcc4;
  --tarnished-brass: #8b7355;
  --oxidized-bronze: #5c4a35;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Crimson Pro', serif;
  background-color: var(--peat-black);
  color: var(--parchment);
  overflow-x: hidden;
  line-height: 1.72;
  font-size: 17px;
  font-weight: 400;
}

/* Grain overlay on entire page */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* === THE THRESHOLD === */
#threshold {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--peat-black);
}

.threshold-texture {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(139, 34, 82, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(74, 48, 128, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(26, 107, 74, 0.06) 0%, transparent 50%);
  z-index: 1;
}

.threshold-mosaic-border {
  position: absolute;
  inset: 0;
  border: 12px solid transparent;
  border-image: repeating-linear-gradient(
    45deg,
    var(--deep-ruby) 0px,
    var(--deep-ruby) 8px,
    var(--amethyst-dusk) 8px,
    var(--amethyst-dusk) 16px,
    var(--forest-emerald) 16px,
    var(--forest-emerald) 24px,
    var(--antique-gold) 24px,
    var(--antique-gold) 32px
  ) 12;
  opacity: 0.25;
  z-index: 2;
}

.threshold-collage-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.5;
}

.collage-fragment {
  position: absolute;
  mix-blend-mode: screen;
}

.frag-botanical {
  width: 180px;
  height: 280px;
  top: 10%;
  left: 8%;
  animation: floatSlow 20s ease-in-out infinite;
}

.frag-circuit {
  width: 260px;
  height: 180px;
  top: 15%;
  right: 8%;
  animation: floatSlow 25s ease-in-out infinite reverse;
}

.frag-vine-left {
  width: 80px;
  height: 500px;
  top: 10%;
  left: 2%;
}

.frag-vine-right {
  width: 80px;
  height: 500px;
  top: 10%;
  right: 2%;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(1deg); }
  50% { transform: translateY(-8px) rotate(-0.5deg); }
  75% { transform: translateY(-20px) rotate(0.5deg); }
}

.threshold-content {
  position: relative;
  z-index: 3;
  text-align: center;
}

.brass-plate {
  display: inline-block;
  padding: 2.5rem 4rem;
  position: relative;
}

.plate-border {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--antique-gold), transparent);
  opacity: 0.4;
}

.site-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(48px, 8vw, 96px);
  letter-spacing: 0.12em;
  color: var(--parchment);
  text-transform: uppercase;
  padding: 1.5rem 0;
  text-shadow: 0 0 80px rgba(196, 149, 42, 0.25);
}

.title-dot {
  color: var(--antique-gold);
}

/* === MAIN === */
#cabinet-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* === SECTIONS === */
.cabinet-section {
  padding: 6rem 0;
  border-bottom: 1px solid rgba(92, 74, 53, 0.2);
  opacity: 0;
  transition: opacity 1.2s ease-out;
}

.cabinet-section:last-child {
  border-bottom: none;
}

.cabinet-section.visible {
  opacity: 1;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.label-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--deep-ruby);
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.section-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(24px, 4vw, 42px);
  letter-spacing: 0.12em;
  color: var(--parchment);
  white-space: nowrap;
  text-transform: uppercase;
}

.label-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--antique-gold), transparent);
  opacity: 0.2;
}

.section-description {
  font-family: 'Crimson Pro', serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.72;
  color: var(--parchment);
  max-width: 700px;
  margin-bottom: 3rem;
  opacity: 0.7;
}

/* === SPECIMEN GRID === */
.specimen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 3px;
  grid-auto-flow: dense;
  border: 1px solid var(--dark-umber);
}

.specimen-card {
  perspective: 1000px;
  cursor: pointer;
  border: 1px solid var(--dark-umber);
}

.card-tall { grid-row: span 2; }
.card-wide { grid-column: span 2; }
.card-triple { grid-column: span 3; }
.card-standard { grid-row: span 1; grid-column: span 1; }
.card-small { grid-row: span 1; grid-column: span 1; }

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.card-tall .card-inner { min-height: 446px; }
.card-wide .card-inner { min-height: 220px; }
.card-triple .card-inner { min-height: 220px; }

.specimen-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  overflow: hidden;
}

.card-front {
  background: linear-gradient(145deg, var(--aged-walnut), var(--dark-umber));
  display: flex;
  flex-direction: column;
}

.card-back {
  background: var(--dark-umber);
  transform: rotateY(180deg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
}

/* Islamic geometric tessellation on card backs */
.card-back-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    linear-gradient(30deg, var(--amethyst-dusk) 12%, transparent 12.5%, transparent 87%, var(--amethyst-dusk) 87.5%, var(--amethyst-dusk)),
    linear-gradient(150deg, var(--amethyst-dusk) 12%, transparent 12.5%, transparent 87%, var(--amethyst-dusk) 87.5%, var(--amethyst-dusk)),
    linear-gradient(30deg, var(--amethyst-dusk) 12%, transparent 12.5%, transparent 87%, var(--amethyst-dusk) 87.5%, var(--amethyst-dusk)),
    linear-gradient(150deg, var(--amethyst-dusk) 12%, transparent 12.5%, transparent 87%, var(--amethyst-dusk) 87.5%, var(--amethyst-dusk)),
    linear-gradient(60deg, var(--forest-emerald) 25%, transparent 25.5%, transparent 75%, var(--forest-emerald) 75%, var(--forest-emerald)),
    linear-gradient(60deg, var(--forest-emerald) 25%, transparent 25.5%, transparent 75%, var(--forest-emerald) 75%, var(--forest-emerald));
  background-size: 40px 70px;
  background-position: 0 0, 0 0, 20px 35px, 20px 35px, 0 0, 20px 35px;
  pointer-events: none;
}

.card-texture {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    radial-gradient(ellipse at center, rgba(232, 220, 196, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.card-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  margin: 0;
}

.card-visual svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
}

/* Specimen label — cream rectangle at bottom */
.specimen-label {
  padding: 0.5rem 0.75rem;
  background: var(--parchment);
  border-top: 1px solid var(--oxidized-bronze);
  position: relative;
}

.card-catalogue {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--tarnished-brass);
  display: block;
  margin-bottom: 0.15rem;
}

.card-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--dark-umber);
  font-weight: 400;
  line-height: 1.4;
}

.card-details {
  width: 100%;
  position: relative;
  z-index: 1;
}

.detail-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--antique-gold);
  display: block;
  margin-top: 0.8rem;
  margin-bottom: 0.2rem;
}

.detail-label:first-child {
  margin-top: 0;
}

.card-details p {
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(232, 220, 196, 0.75);
  line-height: 1.6;
}

/* Card hover — border glow */
.specimen-card:hover .card-front {
  box-shadow: inset 0 0 30px rgba(196, 149, 42, 0.08);
}

/* === CONTINUUM THREAD === */
#continuum-thread {
  padding: 2rem 0;
  overflow: hidden;
  border-top: 1px solid rgba(92, 74, 53, 0.15);
  border-bottom: 1px solid rgba(92, 74, 53, 0.15);
  background: var(--dark-umber);
}

.thread-container {
  width: 100%;
  overflow: hidden;
}

.thread-svg {
  width: 4000px;
  height: 60px;
  animation: scroll-thread 60s linear infinite;
}

@keyframes scroll-thread {
  from { transform: translateX(0); }
  to { transform: translateX(-2000px); }
}

/* === ARCHIVE ENTRIES === */
.archive-entries {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.archive-entry {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  border-left: 2px solid var(--oxidized-bronze);
  transition: border-color 0.4s ease, background-color 0.4s ease;
}

.archive-entry:hover {
  border-left-color: var(--deep-ruby);
  background-color: rgba(42, 31, 20, 0.5);
}

.entry-marker {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.entry-marker svg {
  width: 100%;
  height: 100%;
}

.entry-content {
  flex: 1;
}

.entry-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--antique-gold);
  opacity: 0.6;
  display: block;
  margin-bottom: 0.5rem;
}

.entry-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--parchment);
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.entry-text {
  font-family: 'Crimson Pro', serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.72;
  color: var(--parchment);
  opacity: 0.7;
}

/* === INNER SANCTUM === */
#inner-sanctum {
  position: relative;
  padding: 8rem 2rem;
  background: linear-gradient(180deg, var(--dark-umber), var(--deep-ruby) 50%, var(--dark-umber));
  overflow: hidden;
}

.sanctum-grain {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
}

.sanctum-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.sanctum-label {
  justify-content: center;
  margin-bottom: 3rem;
}

.sanctum-label .label-line {
  display: none;
}

.sanctum-manifesto p {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  line-height: 1.8;
  color: var(--parchment);
  margin-bottom: 2rem;
  opacity: 0.85;
}

.sanctum-manifesto p:last-child {
  font-weight: 600;
  font-style: italic;
  color: var(--antique-gold);
  opacity: 0.7;
  margin-bottom: 0;
}

/* === METHOD GRID === */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 3px;
  margin-top: 2rem;
}

.method-card {
  padding: 2rem;
  border: 1px solid var(--oxidized-bronze);
  background: linear-gradient(145deg, rgba(61, 46, 31, 0.4), rgba(42, 31, 20, 0.6));
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.method-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.method-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 1.5rem;
}

.method-icon svg {
  width: 100%;
  height: 100%;
}

.method-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.12em;
  color: var(--parchment);
  margin-bottom: 0.75rem;
}

.method-text {
  font-family: 'Crimson Pro', serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.72;
  color: var(--parchment);
  opacity: 0.7;
}

/* === THE SEAL (FOOTER) === */
#cabinet-seal {
  position: relative;
  padding: 5rem 2rem;
  text-align: center;
  background-color: var(--peat-black);
  border-top: 1px solid rgba(92, 74, 53, 0.15);
}

.seal-flourish {
  position: absolute;
  width: 60px;
  height: 60px;
}

.seal-flourish.top-left { top: 1rem; left: 1rem; }
.seal-flourish.top-right { top: 1rem; right: 1rem; }
.seal-flourish.bottom-left { bottom: 1rem; left: 1rem; }
.seal-flourish.bottom-right { bottom: 1rem; right: 1rem; }

.seal-flourish svg {
  width: 100%;
  height: 100%;
}

.seal-emblem {
  margin: 0 auto 2rem;
  width: 140px;
  height: 140px;
}

.seal-emblem svg {
  width: 100%;
  height: 100%;
}

.seal-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: rgba(232, 220, 196, 0.4);
  margin-bottom: 0.5rem;
}

.seal-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(196, 149, 42, 0.25);
}

/* === VINE ANIMATION === */
.vine-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.vine-path.animated {
  transition: stroke-dashoffset 4s ease-in-out;
  stroke-dashoffset: 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .specimen-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .card-wide { grid-column: span 2; }
  .card-triple { grid-column: span 2; }
  .card-tall .card-inner { min-height: 340px; }

  .section-label { flex-wrap: wrap; }
  .label-line { display: none; }

  .archive-entry {
    flex-direction: column;
    gap: 1rem;
  }

  #cabinet-main { padding: 0 1rem; }
  .cabinet-section { padding: 4rem 0; }

  #inner-sanctum { padding: 5rem 1.5rem; }
}

@media (max-width: 480px) {
  .specimen-grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: span 1; }
  .card-triple { grid-column: span 1; }
  .card-tall .card-inner { min-height: 300px; }
  .method-grid { grid-template-columns: 1fr; }

  .brass-plate { padding: 1.5rem 2rem; }

  .seal-flourish { display: none; }
}
