/* ==========================================================================
   MISPLACED Style.css

   Structure:
     1. Root
     2. Reset / base
     3. Signature CRT scanline overlay
     4. Typography
     5. Layout utilities
     6. Buttons
     7. Site navigation (2D pages)
     8. Panels / cards
     9. Webring & badge row
     10. Chatbox embed
     11. Form controls (range / checkbox / radio)
     12. 3D scene overlay (aframe / three.js specific)
     13. Utilities & responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Root
   -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* -- color: deep-CRT navy base, hot-pink / cyan signal accents -- */
  --color-bg:             #042604;  /* MainBG*/
  --color-bg-alt:         #0a380a;  /* BoxBG */
  --color-surface:        #0a380a;  /* Surface */
  --color-surface-raised: #24304f;  /* ButtonBG */
  --color-surface-light:  #f5eef2;  /* Post-it Color */
  --color-border:         #031f02;  /* Box Border */
  --color-border-light:   #dcd0d8;  /* Unused */
  --color-header:         #011701;  /* HeaderBG */

  --color-text:           #eef1f7;  /* Standard Text */
  --color-text-muted:     #9fb0cc;  /* Nav and Blog */
  --color-text-inverse:   #221826;  /* Post-it Text and other inverse colorings */

  --color-accent:         #1bad18;  /* Green — Accent */
  --color-accent-soft:    #65cf63;  /* Btn Hover */
  --color-accent-2:       #5fd4ff;  /* Cyan — Secondary Accent and Eyebrow */
  --color-accent-2-soft:  #a9e9ff;  /* Unused */
  --color-warning:        #ffb454;  /* Unused */
  --color-danger:         #ff6b6b;  /* Unused */

  /* -- type -- */
  --font-display: 'Silkscreen', 'Courier New', monospace;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --fs-xs:   1.00rem;
  --fs-sm:   1.25rem;
  --fs-base: 1.5rem;
  --fs-md:   1.65rem;
  --fs-lg:   1.75rem;
  --fs-xl:   2rem;
  --fs-2xl:  2.75rem;

  /* -- spacing scale -- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;

  /* -- shape / shadow -- */
  --radius-sm: 0px;   /* All Radius looked bad ngl, same with shadows */
  --radius-md: 0px;
  --radius-lg: 0px;
  --shadow-soft:  0 0px 0px rgba(0, 0, 0, 0.35);
  --shadow-inset: inset 0 0 0 0px rgba(255, 255, 255, 0.06);

  --content-width: 72rem;
  --transition-fast: 120ms ease;
  --transition-med: 240ms ease;   /* Currently unused */
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */
 
*, *::before, *::after { box-sizing: border-box; }
 
html {
  scroll-behavior: smooth;
}
 
body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /*text-shadow: -1px 0 rgba(255, 60, 140, 0.55), 1px 0 rgba(95, 212, 255, 0.55); */ /*Too much even for me */
}
 
img { max-width: 100%; display: block; }
 
a {
  color: var(--color-accent-2);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover, a:focus-visible { color: var(--color-accent); }
 
/* Consistent, visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--color-accent-2);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
 
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
 
/* --------------------------------------------------------------------------
   3. SIGNATURE — CRT SCANLINE OVERLAY
   Scan lines added so even the low render 2D version is on theme
   -------------------------------------------------------------------------- */
 
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  animation: crt-flicker 4.5s infinite;
}
 
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.6) 100%);
}
 
@keyframes crt-flicker {    /* Pretty sure this doesn't work... eh oh well */
  0%, 45%, 95% { opacity: 1; }
  30% { opacity: 0.7; }
  70% { opacity: 0.8; }
  90% { opacity: 0.5; }
}
 
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
 
/* --------------------------------------------------------------------------
   4. TYPOGRAPHY
   -------------------------------------------------------------------------- */
 
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--color-text);
  margin: 0 0 var(--space-3);
  /* CRT-glitch signature Split red and blue channels*/
  text-shadow: -1px 0 rgba(255, 60, 140, 0.55), 1px 0 rgba(95, 212, 255, 0.55);
}
 
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
 
h1::after {
  content: "_";
  color: var(--color-accent);
  animation: blink 1.1s steps(1) infinite;
}
 
@keyframes blink { 50% { opacity: 0; } }
 
p { margin: 0 0 var(--space-3); }
 
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-2);
  margin-bottom: var(--space-2);
}
 
/* --------------------------------------------------------------------------
   5. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
 
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container-center {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
  flex-direction: column;
  align-items: center;
  text-align: center;
}
 
.stack > * + * { margin-top: var(--space-3); }
 
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
 
.grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
 
.center-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-5);
}
 
/* --------------------------------------------------------------------------
   6. BUTTONS
   `.button` is legacy; `.btn` should be used moving forward.
   -------------------------------------------------------------------------- */
 
.btn, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6em 1.4em;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
 
.btn:hover, .button:hover {
  border-color: var(--color-accent-2);
  box-shadow: 0 0 0 1px var(--color-accent-2) inset;
  transform: translateY(-1px);
  color: var(--color-text);
}
 
.btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-inverse);
}
.btn--primary:hover { background: var(--color-accent-soft); border-color: var(--color-accent-soft); }
 
.btn--secondary {
  background: transparent;
  border-color: var(--color-border);
}
 
.button_holder {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  align-items: center;
}
 
/* --------------------------------------------------------------------------
   7. SITE NAVIGATION (2D pages: misplaced2d.html)
   -------------------------------------------------------------------------- */
 
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-header);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}
 
/* legacy */
.header { padding: var(--space-3) var(--space-4); text-align: center; }
 
.site-nav {
  list-style: none;
  display: flex;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
}
 
.site-nav a, .header ul li a {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
 
.site-nav a[aria-current="page"],
.site-nav a.is-active,
.site-nav a:hover,
.header ul li a:hover {
  color: var(--color-accent);
}
 
.site-logo {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--color-text);
  letter-spacing: 0.04em;
}
.site-logo:hover { color: var(--color-accent-2); }
 
.header ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  padding: 0;
  margin: var(--space-2) 0;
}
 
/* --------------------------------------------------------------------------
   8. PANELS / CARDS (about section, project post-its, blog entries)
   -------------------------------------------------------------------------- */
 
.panel, .content article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-soft), var(--shadow-inset), 0 0 24px rgba(95, 212, 255, 0.06);
}
 
.content { padding: var(--space-4); max-width: var(--content-width); margin-inline: auto; }
.content article + article { margin-top: var(--space-4); }
 
.post-it {
  background: var(--color-surface-light);
  color: var(--color-text-inverse);
  border-radius: 2px var(--radius-md) var(--radius-md) 2px;
  padding: var(--space-3);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.35);
  transform: rotate(-1.5deg);
  transition: transform var(--transition-fast);
}
.post-it:nth-child(even) { transform: rotate(1.5deg); }
.post-it:hover, .post-it:focus-within { transform: rotate(0deg) scale(1.02); }
 
/* --------------------------------------------------------------------------
   9. WEBRING & BADGE ROW
   -------------------------------------------------------------------------- */
 
.webring, .badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3);
}
 
.webring img, .badge-row img { image-rendering: pixelated; }
 
.webring-info a, .webring-links a {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
 
/* --------------------------------------------------------------------------
   10. CHATBOX EMBED
   -------------------------------------------------------------------------- */
 
.chatbox-frame {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
 
.chatbox-frame iframe { display: block; width: 100%; border: 0; }
 
/* --------------------------------------------------------------------------
   11. FORM CONTROLS (UNUSED, sliders, checkboxes, etc)
   -------------------------------------------------------------------------- */
 
fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
legend { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; }
 
input[type="range"] { accent-color: var(--color-accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-accent); }
 
/* --------------------------------------------------------------------------
   12. 3D SCENE OVERLAY (aframe / three.js specific - misplaced3d.html). 
   Kept as distinct, prefixed rules since these are rendered onto in-scene
   HTMLMesh canvases, not the document itself.
   -------------------------------------------------------------------------- */
 
canvas { width: 90%; height: 90%; }
 
.viewer {
  position: absolute;
  top: 15%;
  left: 5%;
  display: flex;
  flex: 50%;
  width: 90%;
  overflow: auto;
  align-items: center;
  justify-content: center;
  margin: var(--space-3);
}
 
#screen {
  background-color: transparent;
  position: absolute;
  border: 3px solid var(--color-accent-2);
  margin: 0;
  padding: 0;
  width: 40vw;
  height: 50vh;
  border-radius: 3vw;
  top: 15vh;
  left: 6.8vw;
  z-index: 1;
}
 
#dom-overlay {
  font-family: var(--font-mono);
  color: var(--color-text);
  position: absolute;
}
 
#dom-overlay .overlay-footer {
  background: rgba(0, 0, 0, 0.4);
  padding: var(--space-3);
  margin: 0;
  position: absolute;
  inset: auto 0 0 0;
}
 
#menu-sec .overlay-footer {
  padding: var(--space-3);
  position: absolute;
  color: var(--color-text-inverse);
}
 
.menu {   /* Steve Buschemi picture for testing menu background, UNUSED */
  background-image: url('https://misplaced.neocities.org/testing/steve.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 30%;
  height: 40%;
}
 
.highlight {
  font-family: var(--font-mono);
  color: #fff;
  width: 100%;
  text-align: center;
  margin: 0;
  padding: 0;
}
 
.highlight a { color: inherit; text-decoration: none; }
 
/* badTV shader canvas overlay target (misplaced3d.html TV screen) */
.tv-shader-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
 
/* --------------------------------------------------------------------------
   12b. JOURNAL / PROJECTS TABS & BLOG LIST (misplaced2d.html)
   -------------------------------------------------------------------------- */
 
.journal {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: var(--space-4);
  align-items: start;
}
 
.post-it-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: sticky;
  top: calc(var(--space-6) + var(--space-3));
}
 
.post-it-tabs .post-it {
  border: none;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}
 
.post-it-tabs .post-it.is-active {
  outline: 2px solid var(--color-accent);
  transform: rotate(0deg) scale(1.03);
}
 
.journal-content > * + * { margin-top: var(--space-4); }
 
.blog-entry {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-3);
}
.blog-entry:last-child { border-bottom: none; }
 
.blog-entry time {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
 
[hidden] { display: none !important; }
 
/* --------------------------------------------------------------------------
   13. UTILITIES & RESPONSIVE
   -------------------------------------------------------------------------- */
 
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
 
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
 
@media (max-width: 640px) {
  :root { --fs-xl: 1.6rem; --fs-lg: 1.25rem; }
  .container, .content { padding-inline: var(--space-3); }
  .site-header { flex-direction: column; align-items: flex-start; }
  #screen { width: 90vw; height: 40vh; left: 5vw; }
  .journal { grid-template-columns: 1fr; }
  .post-it-tabs { position: static; flex-direction: row; flex-wrap: wrap; }
}
