/* FOSSIL: styles modeled on nohello.net (https://github.com/nohello-net/site) */

@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700,900&display=swap');

:root {
  --ink: #04143a;
  --text: #15171a;
  --muted: #616061;
  --soft: #81899c;
  --accent: #b7410e; /* rust, naturally */
  --good: #2f9e44;
  --bg: #fefefe;
  --link: #4a90e2;
  --heading-soft: #5b6a9a;
  --surface: #fff; /* chat cards, hovered stage cards, curve dots */
  --card: #eef0f7; /* stage cards at rest */
  --chat-text: #1d1c1d;
  --axis: #d9d9d9;
  --raise-dark: #d9d9d9; /* soft "neumorphic" shadow pair */
  --raise-light: #fff;
  --hover-shadow: #ddd;
  --footer-top: #fff;
  --footer-bottom: #eee;
  --toast-bg: #04143a;
  --toast-fg: #fff;

  color-scheme: light dark;
}

/* Dark theme.
   - With JS: fossil.js sets <html data-theme="light|dark"> from the saved choice or the system theme.
   - Without JS: the media query below follows the system theme.
   The two variable lists must stay identical. */
:root[data-theme='dark'] {
  --ink: #e8ebf2;
  --text: #d4d8e1;
  --muted: #a3a9b7;
  --soft: #7f879a;
  --accent: #e0672f; /* brighter rust so it stays readable on dark */
  --good: #40c057;
  --bg: #0f131c;
  --link: #74a9ec;
  --heading-soft: #9aa8d6;
  --surface: #1a2030;
  --card: #161b27;
  --chat-text: #e6e8ee;
  --axis: #343b4d;
  --raise-dark: rgba(0, 0, 0, 0.55);
  --raise-light: rgba(255, 255, 255, 0.03);
  --hover-shadow: rgba(0, 0, 0, 0.6);
  --footer-top: #0f131c;
  --footer-bottom: #0a0d14;
  --toast-bg: #e8ebf2;
  --toast-fg: #0f131c;
  color-scheme: dark;
}

:root[data-theme='light'] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ink: #e8ebf2;
    --text: #d4d8e1;
    --muted: #a3a9b7;
    --soft: #7f879a;
    --accent: #e0672f; /* brighter rust so it stays readable on dark */
    --good: #40c057;
    --bg: #0f131c;
    --link: #74a9ec;
    --heading-soft: #9aa8d6;
    --surface: #1a2030;
    --card: #161b27;
    --chat-text: #e6e8ee;
    --axis: #343b4d;
    --raise-dark: rgba(0, 0, 0, 0.55);
    --raise-light: rgba(255, 255, 255, 0.03);
    --hover-shadow: rgba(0, 0, 0, 0.6);
    --footer-top: #0f131c;
    --footer-bottom: #0a0d14;
    --toast-bg: #e8ebf2;
    --toast-fg: #0f131c;
  }
}

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

html,
body,
h1,
h2,
h3,
p,
ul,
ol,
li,
figure {
  margin: 0;
  padding: 0;
}

a {
  color: var(--link);
  text-decoration: none;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

/* ---------- base ---------- */
body {
  line-height: 1;
  font-family: lato, ubuntu, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Cantarell,
    'Open Sans', 'Helvetica Neue', sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-size: 19px;
  background-color: var(--bg);
  color: var(--ink);
}

#wholesite {
  transition: filter 1.2s ease;
}

p {
  color: var(--text);
  line-height: 31px;
}

.container,
footer {
  max-width: 1100px;
  margin: 60px auto;
}

section.container {
  margin: 120px auto;
}

/* ---------- hero ---------- */
.hero {
  margin: 150px auto 200px auto;
}

.acronym {
  display: block;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 14px;
}

.acronym b {
  color: var(--accent);
  font-weight: 900;
}

h1.name {
  font-size: 94px;
  font-weight: 700;
  line-height: 1;
}

.subtitle {
  display: block;
  font-size: 24px;
  font-weight: 300;
  color: var(--soft);
  margin-top: 10px;
}

.lead {
  font-size: 44px;
  font-weight: 300;
  margin-top: 60px;
  line-height: 55px;
  max-width: 900px;
}

/* ---------- two-column sections ---------- */
.sections {
  vertical-align: top;
  display: inline-block;
  min-height: 50px;
}

.sectionleft {
  width: 40%;
  padding-right: 40px;
}

.sectionright {
  width: 59%;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 36px;
  margin-bottom: 15px;
}

.section-intro {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 30px;
}

.lang {
  color: var(--accent);
  border-right: 3px solid var(--accent);
  padding-right: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.list-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--heading-soft);
  line-height: 26px;
  margin-bottom: 22px;
}

.list-card p {
  font-size: 18px;
  color: var(--muted);
  line-height: 26px;
  margin-bottom: 20px;
}

.list-card strong {
  color: var(--ink);
}

/* ---------- chat examples ---------- */
.list-card.example {
  margin: 30px 0;
  padding: 25px 25px 10px 25px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: -20px 20px 60px var(--raise-dark), 20px -20px 60px var(--raise-light);
}

.chat {
  position: relative;
  padding: 0 0 15px 52px;
  line-height: 1.35;
  min-height: 57px;
}

.chat .avatar {
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  border-radius: 5px;
  background: var(--c);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: grid;
  place-items: center;
}

.chat .chatname {
  font-weight: 700;
  font-size: 16px;
  color: var(--chat-text);
}

.chat .chattime {
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
}

.chat .chatmessage {
  font-size: 16px;
  color: var(--chat-text);
}

/* ---------- lists ---------- */
.container ul,
.container ol {
  list-style: none;
  font-size: 18px;
  color: var(--muted);
  line-height: 26px;
  margin: -8px 0 20px 20px;
}

.container ul li {
  padding-left: 22px;
  text-indent: -22px;
}

.container ul li::before {
  display: inline-block;
  width: 22px;
  text-indent: 0;
  padding-right: 0 !important;
}

ul.plain li::before {
  content: '–';
  color: var(--soft);
  padding-right: 10px;
}

.yepyep ul li::before {
  content: '✓';
  font-size: 14px;
  font-weight: bold;
  color: var(--good);
  padding-right: 10px;
}

.nonos ul.plain li::before {
  content: '·';
  font-weight: bold;
  color: var(--soft);
}

ol.questions {
  counter-reset: q;
}

ol.questions li {
  counter-increment: q;
  margin-bottom: 8px;
  padding-left: 34px;
  text-indent: -34px;
}

ol.questions li::before {
  content: counter(q);
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 50%;
  background: #2f9e44; /* fixed: keeps white numbers readable in both themes */
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  text-indent: 0;
}

/* ---------- the cycle ---------- */
.curve {
  margin: 0 0 60px 0;
}

.curve svg {
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: inherit;
}

.curve .axis {
  stroke: var(--axis);
  stroke-width: 2;
}

.curve .axis-label {
  fill: var(--soft);
  font-size: 14px;
}

.curve .hype {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
}

.curve .original {
  fill: none;
  stroke: var(--soft);
  stroke-width: 2.5;
  stroke-dasharray: 8 8;
}

.curve .original-label {
  fill: var(--soft);
  font-size: 15px;
  font-style: italic;
}

.curve .stage-dot circle {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 4;
}

.curve .stage-dot text {
  fill: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.card {
  position: relative;
  padding: 35px 35px 15px 35px;
  border-radius: 10px;
  background-color: var(--card);
  transition: transform 0.5s, background-color 0.5s, box-shadow 0.5s;
}

.card:hover {
  transform: scale(1.02);
  background-color: var(--surface);
  box-shadow: 0 5px 50px -8px var(--hover-shadow);
}

.card .stage {
  position: absolute;
  top: 18px;
  right: 28px;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  opacity: 0.15;
}

.card h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 18px;
}

.card p {
  font-size: 17px;
  color: var(--muted);
  line-height: 26px;
  margin-bottom: 16px;
}

/* ---------- principle ---------- */
.principle {
  text-align: center;
}

.principle .section-title {
  color: var(--soft);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.principle-lead {
  font-size: 44px;
  font-weight: 300;
  line-height: 55px;
  color: var(--ink);
  max-width: 900px;
  margin: 30px auto 60px auto;
}

.container ul.mistakes {
  margin: 0 auto 60px auto;
  font-size: 24px;
  line-height: 46px;
  color: var(--ink);
}

.container ul.mistakes li {
  padding-left: 0;
  text-indent: 0;
}

.mistakes s {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  color: var(--soft);
}

.closer {
  font-size: 22px;
  color: var(--muted);
}

/* ---------- footer ---------- */
footer {
  max-width: none;
  margin-bottom: 0;
  padding: 150px 150px 80px 150px;
  font-size: 14px;
  font-weight: 300;
  background: linear-gradient(180deg, var(--footer-top) 0%, var(--footer-bottom) 45%);
}

footer p {
  color: var(--muted);
  max-width: 1100px;
  margin: 0 auto;
}

footer a {
  color: var(--accent);
  text-decoration: underline;
}

footer a:hover {
  text-decoration: none;
}

/* ---------- theme toggle ---------- */
.theme-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--axis);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 18px -6px var(--hover-shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.theme-toggle[hidden] {
  display: none; /* stays hidden without JS, since it couldn't work */
}

.theme-toggle:hover {
  transform: rotate(-15deg) scale(1.06);
  border-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* show the moon in light mode (go dark), the sun in dark mode (go light) */
.theme-toggle .icon-sun,
:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}

/* ---------- easter egg: type "rewrite" ---------- */
body.fossilized #wholesite {
  filter: sepia(0.9) contrast(0.9) brightness(0.95);
}

#fossilized-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 40px);
  padding: 14px 22px;
  border-radius: 10px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

#fossilized-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .hero {
    margin: 60px auto;
  }

  .container {
    padding: 15px;
  }

  section.container {
    margin: 60px auto;
  }

  footer {
    padding: 120px 30px 60px 30px;
  }
}

@media (max-width: 768px) {
  .sections {
    width: 100%;
    padding-right: 0;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .curve .stage-dot text {
    font-size: 24px;
  }

  .curve .original-label {
    display: none;
  }
}

@media (max-width: 425px) {
  h1.name {
    font-size: 56px;
  }

  .acronym {
    font-size: 12px;
  }

  .lead,
  .principle-lead {
    margin-top: 40px;
    font-size: 24px;
    line-height: 32px;
  }

  .section-title {
    font-size: 22px;
    line-height: 28px;
  }

  .container ul.mistakes {
    font-size: 18px;
    line-height: 30px;
  }

  .mistakes li {
    margin-bottom: 12px;
  }

  .card {
    padding: 25px 20px 10px 20px;
  }

  footer {
    padding: 80px 15px 40px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang {
    animation: none;
    border-right: 0;
  }

  .card,
  #wholesite,
  .theme-toggle {
    transition: none;
  }
}
