/* =========================================================
   FREEPG.SITE — design system
   Concept: a small "OS" with two running programs —
   gitlite.service (README search) & arcade.service (WASM arcade).
   Hero renders as a boot log; each product is a window.
   ========================================================= */

:root {
  --bg:         #0c0e0f;
  --bg-elev:    #15181a;
  --bg-elev-2:  #1b1f22;
  --border:     #2a2f33;
  --border-soft:#22262a;

  --text:       #ddd8cb;   /* warm parchment, not stark white */
  --text-dim:   #939a9e;
  --text-faint: #5c6367;

  --mint:       #6fd9a8;   /* GitLite / code */
  --mint-dim:   rgba(111, 217, 168, .14);
  --mint-line:  rgba(111, 217, 168, .35);

  --amber:      #f0a860;   /* Arcade / CRT */
  --amber-dim:  rgba(240, 168, 96, .14);
  --amber-line: rgba(240, 168, 96, .35);

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pixel: 'Press Start 2P', var(--mono);

  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.75;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 22px 22px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

a { color: inherit; }

::selection { background: var(--mint-dim); color: var(--text); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(12,14,15,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: .9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  color: var(--text);
  white-space: nowrap;
}

.brand__dot { color: var(--mint); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .82rem;
}

.tabs a {
  text-decoration: none;
  color: var(--text-dim);
  padding: .35rem .65rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.tabs a:hover,
.tabs a:focus-visible {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-elev-2);
}

.tabs a:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ---------- hero / boot sequence ---------- */

.hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 3.2rem 1.2rem 2.4rem;
}

.hero p.tagline {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: .95rem;
  margin: 0 0 1.6rem;
}

.boot {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.boot__bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .9rem;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-faint);
}

.boot__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); opacity: .5; }

.boot__body {
  padding: 1.6rem 1.4rem 1.8rem;
  font-family: var(--mono);
  font-size: .92rem;
}

.type-line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  max-width: 100%;
  margin: 0 0 .55rem;
  animation: type steps(42, end) 1.1s forwards;
}

.type-line--ok { color: var(--mint); }
.type-line--ok .type-line__label { color: var(--text-dim); }
.type-line--muted { color: var(--text-dim); }
.type-line--cursor {
  width: auto;
  overflow: visible;
  animation: none;
  color: var(--text);
}

.type-line:nth-child(1) { animation-delay: .1s; }
.type-line:nth-child(2) { animation-delay: 1.0s; }
.type-line:nth-child(3) { animation-delay: 2.0s; }
.type-line:nth-child(4) { animation-delay: 3.0s; }
.type-line:nth-child(5) { animation-delay: 3.9s; }

@keyframes type { from { width: 0; } to { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .type-line { width: 100%; animation: none; }
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--mint);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero__cta {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: 1.3rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--border-soft);
}

/* ---------- buttons ---------- */

.cmd-btn {
  font-family: var(--mono);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.05rem;
  border-radius: 7px;
  border: 1px solid;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.cmd-btn::before { content: "$"; opacity: .6; }

.cmd-btn--mint {
  color: var(--mint);
  border-color: var(--mint-line);
  background: var(--mint-dim);
}
.cmd-btn--mint:hover { transform: translateY(-2px); box-shadow: 0 8px 22px var(--mint-dim); background: rgba(111,217,168,.2); }

.cmd-btn--amber {
  color: var(--amber);
  border-color: var(--amber-line);
  background: var(--amber-dim);
}
.cmd-btn--amber:hover { transform: translateY(-2px); box-shadow: 0 8px 22px var(--amber-dim); background: rgba(240,168,96,.2); }

.cmd-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* ---------- main / windows ---------- */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.2rem 3rem;
}

.window {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.6rem;
  scroll-margin-top: 90px;
  overflow: hidden;
}

.window--accent-mint { border-color: var(--mint-line); }
.window--accent-amber { border-color: var(--amber-line); }

.window__bar {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .9rem;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border-soft);
}

.window__dots { display: flex; gap: 5px; }
.window__dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); opacity: .45; }

.window__title {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--text-faint);
  letter-spacing: .02em;
}

.window__body { padding: 1.9rem 1.9rem 2.1rem; position: relative; }

.window__body h2 {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--text);
  margin: 0 0 1rem;
  letter-spacing: -.01em;
}

.window__body h3 {
  font-family: var(--mono);
  font-size: 1rem;
  margin: 1.7rem 0 .7rem;
}

.window--accent-mint .window__body h3 { color: var(--mint); }
.window--accent-amber .window__body h3 { color: var(--amber); }

.window__body p {
  margin: 0 0 1rem;
  word-break: keep-all;
  color: var(--text);
}

.window__body p.lede { color: var(--text-dim); }

.window__body strong { color: var(--text); font-weight: 700; }
.window--accent-mint .window__body strong { color: var(--mint); }
.window--accent-amber .window__body strong { color: var(--amber); }

/* eyebrow pixel badge — used sparingly */
.badge {
  display: inline-block;
  font-family: var(--pixel);
  font-size: .55rem;
  letter-spacing: .05em;
  padding: .45rem .55rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  line-height: 1;
}
.badge--mint { color: var(--mint); background: var(--mint-dim); border: 1px solid var(--mint-line); }
.badge--amber { color: var(--amber); background: var(--amber-dim); border: 1px solid var(--amber-line); }

/* feature grid */
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .9rem;
  margin: 1rem 0 .4rem;
}

.feature {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: var(--bg-elev-2);
}

.feature__label {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-faint);
  margin-bottom: .35rem;
}

.feature p { margin: 0; font-size: .93rem; color: var(--text-dim); }

/* pipeline steps — a real ordered process, numbers carry meaning */
.pipeline {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.pipeline li {
  display: flex;
  gap: .8rem;
  align-items: baseline;
  padding: .7rem .9rem;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-elev-2);
}

.pipeline__idx {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-faint);
  flex-shrink: 0;
}

.pipeline li strong { display: block; margin-bottom: .15rem; font-size: .95rem; }
.pipeline li span { color: var(--text-dim); font-size: .88rem; }

/* scanline motif — arcade window only, very subtle */
.window--scanlines { position: relative; }
.window--scanlines .window__body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(240,168,96,.025) 0px,
    rgba(240,168,96,.025) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* guide steps */
.guide-steps {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  counter-reset: g;
}
.guide-steps li {
  counter-increment: g;
  position: relative;
  padding: .2rem 0 1rem 2.4rem;
  border-left: 1px solid var(--border-soft);
  margin-left: .5rem;
}
.guide-steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.guide-steps li::before {
  content: counter(g, decimal-leading-zero);
  position: absolute;
  left: -0.55rem;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--mint);
  background: var(--bg-elev);
  border: 1px solid var(--mint-line);
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.window--accent-amber .guide-steps li::before { color: var(--amber); border-color: var(--amber-line); }

.guide-steps strong { display: block; font-size: .96rem; margin-bottom: .2rem; }
.guide-steps span { color: var(--text-dim); font-size: .9rem; }

/* keys */
kbd {
  font-family: var(--mono);
  font-size: .78rem;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: .1rem .4rem;
  color: var(--text);
}

/* FAQ accordion */
.faq-item {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  margin-bottom: .6rem;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: .85rem 1rem;
  font-weight: 600;
  font-size: .95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--text-faint);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:focus-visible { outline: 2px solid var(--mint); outline-offset: -2px; }
.faq-item p {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--text-dim);
  font-size: .92rem;
}

/* privacy list */
.plain-list { margin: 1rem 0; padding-left: 1.2rem; }
.plain-list li { margin-bottom: .6rem; color: var(--text); }
.plain-list li::marker { color: var(--text-faint); font-family: var(--mono); }

/* lang sections */
.lang-section { display: none; }

/* footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2.6rem 1.2rem 2.2rem;
  background: var(--bg-elev);
}

.footer__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-faint);
}

.footer__col strong { display: block; color: var(--text-dim); margin-bottom: .5rem; font-size: .78rem; }
.footer__col a { display: block; text-decoration: none; color: var(--text-faint); margin-bottom: .3rem; }
.footer__col a:hover { color: var(--mint); }

.footer__bottom {
  max-width: 960px;
  margin: 1.8rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--border-soft);
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .window__body { padding: 1.4rem 1.2rem 1.6rem; }
  .boot__body { font-size: .8rem; padding: 1.3rem 1rem 1.5rem; }
  .hero { padding: 2.2rem 1rem 1.8rem; }
  .footer__inner { flex-direction: column; gap: 1.4rem; }
}
