/* duh-net.org — The Three Stooges */

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

:root {
  --ink:      #f3ece1;
  --ink-dim:  #b0a695;
  --bg:       #141210;
  --panel:    #1e1a17;
  --line:     #3a332c;
  --accent:   #d8a24a;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, #241f1a 0%, var(--bg) 62%);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.6;
}

/* ------------------------------------------------------------- header */

header {
  text-align: center;
  padding: clamp(38px, 8vw, 84px) 20px clamp(20px, 4vw, 36px);
}

/* Deliberately not uppercased: the name is styled "Duh-Net.org", and
   text-transform would flatten it back to DUH-NET.ORG. */
.kicker {
  margin: 0 0 10px;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(34px, 9vw, 76px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.tagline {
  margin: 14px 0 0;
  font-size: clamp(14px, 3.4vw, 18px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ------------------------------------------------------------ stooges */

.stooges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: clamp(18px, 3vw, 30px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) clamp(40px, 7vw, 72px);
}

.stooge {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  transition: transform 220ms ease, border-color 220ms ease;
}

.stooge:hover,
.stooge:focus-within {
  transform: translateY(-5px);
  border-color: var(--accent);
}

/* Fixed-ratio frame so the three portraits line up despite differing
   source dimensions; the photos are contained, never cropped. */
.frame {
  aspect-ratio: 4 / 5;
  background: #0c0a09;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: grayscale(100%) contrast(1.06);
  transition: filter 300ms ease;
}

.stooge:hover .frame img,
.stooge:focus-within .frame img {
  filter: grayscale(0%) contrast(1);
}

figcaption {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

figcaption h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* Easter egg: hovering a card swaps the Stooge's name for his DUH-NET
   service bot. Both spans are stacked so the heading never reflows. */
.swap {
  position: relative;
  display: inline-block;
  min-height: 1.25em;
}

.swap .a,
.swap .b {
  transition: opacity 260ms ease;
}

.swap .b {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
}

.stooge:hover .swap .a,
.stooge:focus-within .swap .a { opacity: 0; }

.stooge:hover .swap .b,
.stooge:focus-within .swap .b { opacity: 1; }

.stooge:focus { outline: none; }

.real {
  margin: 4px 0 14px;
  font-size: 12.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.bio {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink);
  flex: 1;
}

.quote {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 17px;
  font-style: italic;
  color: var(--accent);
}

/* ------------------------------------------------------------- footer */

footer {
  text-align: center;
  padding: 0 20px clamp(36px, 7vw, 60px);
  color: var(--ink-dim);
  letter-spacing: 0.1em;
}

footer p { margin: 0; }

/* Second easter egg: the "nyuk nyuk nyuk" gives way to the DUH-NET note.
   Both states share one grid cell so the page doesn't jump on hover. */
.egg {
  display: grid;
  max-width: 620px;
  margin: 0 auto;
  cursor: help;
}

.egg:focus { outline: none; }

.egg > * {
  grid-area: 1 / 1;
  transition: opacity 420ms ease;
}

.nyuk {
  font-style: italic;
  align-self: center;
}

.memory {
  opacity: 0;
  font-style: normal;
  letter-spacing: 0.01em;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}

.memory p + p { margin-top: 10px; }

/* The address reads normally to a human but is never a contiguous string in
   the markup: the "@" and "." are injected by CSS, so a scraper parsing the
   HTML sees only "info", "duh-net" and "org" as separate nodes. Selection is
   disabled so it can't be casually copy-pasted either. */
.memory .addr {
  color: var(--accent);
  border-bottom: 1px solid rgba(216, 162, 74, 0.45);
  white-space: nowrap;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.memory .addr .u::after { content: " [at] "; }
.memory .addr .d::after { content: "\002E"; }   /* . */

.memory .server {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.memory .channels {
  margin-top: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
}

/* The server and channel names open the web client on that channel. The
   easter egg is hover-revealed, so these need pointer events re-enabled. */
.memory .server a,
.memory .channels a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 162, 74, 0.35);
  pointer-events: auto;
}

.memory .server a:hover,
.memory .channels a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.egg:hover .nyuk,
.egg:focus-within .nyuk { opacity: 0; }

.egg:hover .memory,
.egg:focus-within .memory { opacity: 1; }

/* ---------------------------------------------------- right-click egg */

/* Kept in the layout (not display:none) so the browser decodes the image up
   front; revealing it is then a single opacity flip with no transition, which
   is what makes it feel instant. */
#flashback {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#flashback.on {
  opacity: 1;
  visibility: visible;
}

#flashback img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  /* the source is a period screenshot; keep its hard pixel edges */
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .stooge, .frame img { transition: none; }
  .stooge:hover, .stooge:focus-within { transform: none; }
}
