/* ============================================================
   openclaw.css — OpenClaw Tutorial
   Crosshill Design dark/teal theme
   ============================================================

   SECTIONS:
   01. Variables & Reset
   02. Base & Typography
   03. Progress Bar
   04. Top Nav
   05. Left Sidebar
   06. Coffee Widget
   07. Mobile Overlay
   08. Hero
   09. Main Content Wrap
   10. Sections & Headings
   11. Code Blocks
   12. Callouts
   13. Prereq Box
   14. Spec Grid          (aws-setup)
   15. Firewall Rule List (aws-setup)
   16. Reveal Animations
   17. Footer
   18. Scrollbar
   19. Responsive

   ============================================================ */


/* ── 01. VARIABLES & RESET ───────────────────────────────── */

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

:root {
  --teal:          #3a9e9e;
  --teal-light:    #5bc8c8;
  --teal-dark:     #2a7070;
  --teal-glow:     rgba(58,158,158,0.13);
  --teal-glow-str: rgba(58,158,158,0.22);
  --bg:            #0d0d0d;
  --bg-card:       #141414;
  --bg-elevated:   #1a1a1a;
  --text:          #e8e8e8;
  --text-muted:    #888;
  --text-dim:      #4a4a4a;
  --border:        rgba(58,158,158,0.18);
  --border-str:    rgba(58,158,158,0.38);
  --mono:          'Space Mono', 'Courier New', monospace;
  --sans:          'Syne', system-ui, sans-serif;
  --radius:        6px;
  --nav-h:         64px;
  --sidebar-w:     210px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }


/* ── 02. BASE & TYPOGRAPHY ───────────────────────────────── */

body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; }

a { color: var(--teal-light); text-decoration: none; }
strong { color: #d4e8e8; font-weight: 600; }

code { font-family: var(--mono); font-size: 0.875em; background: rgba(58,158,158,0.11); color: var(--teal-light); padding: 2px 7px; border-radius: 3px; }


/* ── 03. PROGRESS BAR ────────────────────────────────────── */

.progress-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0%; background: linear-gradient(90deg, var(--teal-dark), var(--teal-light)); z-index: 9999; transition: width 0.1s linear; pointer-events: none; }


/* ── 04. TOP NAV ─────────────────────────────────────────── */

#site-nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; padding: 0 28px 0 20px; background: var(--bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 200; transition: box-shadow 0.3s; }
#site-nav.scrolled { box-shadow: 0 0 28px rgba(58,158,158,0.07); }

.nav-logo img { height: 42px; width: auto; display: block; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; z-index: 201; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--teal); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ── 05. LEFT SIDEBAR ────────────────────────────────────── */

.sidebar { position: fixed; top: var(--nav-h); left: 0; bottom: 0; width: var(--sidebar-w); background: var(--bg); z-index: 150; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--teal-dark); border-radius: 4px; }

.sidebar-inner { display: flex; flex-direction: column; flex: 1; padding: 28px 0 24px; }
.sidebar-nav { flex: 1; }
.sidebar-label { font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); padding: 0 20px 12px; }
.sidebar-nav ul { list-style: none; }
.sidebar-link { display: block; font-family: var(--mono); font-size: 0.71rem; color: #aaa; padding: 9px 20px 9px 22px; border-left: 2px solid transparent; line-height: 1.35; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.sidebar-link:hover { color: var(--teal-light); background: var(--teal-glow); }
.sidebar-link.active { color: var(--teal-light); border-left-color: var(--teal); background: var(--teal-glow); }
.sidebar-nav::after { content: ''; display: block; margin: 20px 20px 0; border-top: 1px solid var(--border); }


/* ── 06. COFFEE WIDGET ───────────────────────────────────── */

.coffee-widget { padding: 20px 16px 8px; display: flex; justify-content: center; }
.coffee-link { display: block; width: 100%; max-width: 160px; transition: transform 0.25s, filter 0.25s; }
.coffee-link:hover { transform: translateY(-3px); filter: drop-shadow(0 6px 18px rgba(58,158,158,0.35)); }
.coffee-svg { width: 100%; height: auto; display: block; }

@keyframes steamRise { 0% { stroke-dashoffset: 0; opacity: 0.6; } 50% { opacity: 0.3; } 100% { stroke-dashoffset: -40; opacity: 0; } }
.steam-1, .steam-2, .steam-3 { stroke-dasharray: 40; stroke-dashoffset: 0; }
.steam-1 { animation: steamRise 2.4s ease-in-out infinite; }
.steam-2 { animation: steamRise 2.4s ease-in-out infinite 0.7s; }
.steam-3 { animation: steamRise 2.4s ease-in-out infinite 1.4s; }


/* ── 07. MOBILE OVERLAY ──────────────────────────────────── */

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 140; backdrop-filter: blur(2px); }


/* ── 08. HERO ────────────────────────────────────────────── */

.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: calc(var(--nav-h) + 56px) 40px 80px calc(var(--sidebar-w) + 40px); overflow: hidden; }

.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 65% 50% at 55% 60%, rgba(58,158,158,0.11) 0%, transparent 70%), radial-gradient(ellipse 35% 28% at 25% 80%, rgba(42,112,112,0.07) 0%, transparent 60%), var(--bg); }
.hero-bg::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(58,158,158,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(58,158,158,0.025) 1px, transparent 1px); background-size: 60px 60px; }
.hero-lobster { font-size: 0.85em; vertical-align: middle; margin-right: 4px; filter: drop-shadow(0 0 8px rgba(255, 80, 40, 0.5));}
.hero-content { position: relative; z-index: 1; max-width: 780px; animation: fadeUp 0.85s ease both; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.hero-eyebrow { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--teal); margin-bottom: 8px; animation: fadeUp 0.85s 0.1s ease both; }
.hero-updated { font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.4); margin-bottom: 18px; animation: fadeUp 0.85s 0.15s ease both; }
.hero-img { max-width: 720px; width: 88%; height: auto; margin-bottom: 30px; filter: drop-shadow(0 0 30px rgba(58,158,158,0.28)); animation: fadeUp 0.85s 0.2s ease both; }
.hero-title { font-size: clamp(2.2rem, 5.5vw, 3.8rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 22px; animation: fadeUp 0.85s 0.3s ease both; }
.hero-title em { font-style: normal; color: var(--teal-light); }
.hero-sub { font-size: 1rem; color: var(--text-muted); max-width: 580px; margin: 0 auto 38px; line-height: 1.78; animation: fadeUp 0.85s 0.4s ease both; }
.hero-cta { display: inline-flex; align-items: center; gap: 8px; padding: 13px 30px; background: var(--teal-glow); color: var(--teal-light); border: 1px solid var(--border-str); border-radius: var(--radius); font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.06em; transition: background 0.25s, border-color 0.25s, box-shadow 0.25s; animation: fadeUp 0.85s 0.5s ease both; }
.hero-cta:hover { background: var(--teal-glow-str); border-color: var(--teal); box-shadow: 0 0 22px rgba(58,158,158,0.18); color: var(--teal-light); }
.hero-cta span { animation: bounce 2s infinite; display: inline-block; }
.hero-scroll-hint { position: absolute; bottom: 22px; left: calc(50% + var(--sidebar-w)/2); transform: translateX(-50%); font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--text-dim); animation: fadeUp 1s 0.8s ease both; }


/* ── 09. MAIN CONTENT WRAP ───────────────────────────────── */

.content-wrap { margin-left: var(--sidebar-w); padding: 0 0 100px; display: flex; flex-direction: column; align-items: center; }
.section-inner { width: 100%; max-width: 860px; padding: 0 48px; }


/* ── 10. SECTIONS & HEADINGS ─────────────────────────────── */

.section { padding: 0; border-bottom: 1px solid var(--border); width: 100%; }
.section:last-child { border-bottom: none; }
.section-inner { padding: 80px 48px; }
.section-tag { font-family: var(--mono); font-size: 0.69rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--teal); margin-bottom: 10px; }
.section h2 { font-size: clamp(1.55rem, 3.2vw, 2.1rem); font-weight: 800; letter-spacing: -0.025em; color: var(--text); margin-bottom: 26px; line-height: 1.15; }
.section h3 { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: var(--teal-light); margin: 38px 0 12px; letter-spacing: 0.03em; }
.section-summary { font-size: 1rem; color: #bfbfbf; line-height: 1.8; }
.section-summary p + p { margin-top: 14px; }
.step-content { margin-bottom: 4px; }
.step-content p { color: var(--text-muted); line-height: 1.75; margin-bottom: 10px; }


/* ── 11. CODE BLOCKS ─────────────────────────────────────── */

.code-block { margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #090909; }
.code-label { font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--teal); background: rgba(58,158,158,0.07); padding: 7px 16px; border-bottom: 1px solid var(--border); }
.code-block pre { position: relative; padding: 18px 16px; overflow-x: auto; margin: 0; }
.code-block code { background: none; padding: 0; font-size: 0.83rem; color: #b0dcdc; line-height: 1.72; white-space: pre; display: block; }


/* ── 12. CALLOUTS ────────────────────────────────────────── */

.callout { padding: 15px 18px; border-radius: var(--radius); margin: 22px 0; font-size: 0.9rem; line-height: 1.65; border-left: 3px solid; }
.callout--info    { background: rgba(58,158,158,0.08);  border-color: var(--teal);    color: #a8d8d8; }
.callout--warn    { background: rgba(220,150,50,0.08);  border-color: #dc9632;        color: #e0bf78; }
.callout--success { background: rgba(58,158,100,0.1);   border-color: #3a9e64;        color: #80d8a8; }
.callout strong { color: inherit; font-weight: 700; }


.bmc-inline-link { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 0.82rem; color: var(--teal-light); border-bottom: 1px solid var(--border-str); padding-bottom: 2px; transition: color 0.2s, border-color 0.2s; }
.bmc-inline-link:hover { color: var(--teal); border-color: var(--teal); }

/* ── 13. PREREQ BOX ──────────────────────────────────────── */

.prereq-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; margin: 26px 0; }
.prereq-title { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--teal); margin-bottom: 14px; }
.prereq-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.prereq-list li { padding-left: 18px; position: relative; color: #b0b0b0; font-size: 0.94rem; }
.prereq-list li::before { content: '→'; position: absolute; left: 0; color: var(--teal); font-family: var(--mono); }
.prereq-list a { color: var(--teal-light); border-bottom: 1px solid var(--border-str); padding-bottom: 1px; transition: color 0.2s, border-color 0.2s; }
.prereq-list a:hover { color: var(--teal); border-color: var(--teal); }

/* ── 14. SPEC GRID (aws-setup) ───────────────────────────── */

.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.spec-card { background: var(--bg-card); border: 1px solid var(--border-str); border-radius: var(--radius); padding: 16px; position: relative; }
.spec-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--teal); border-radius: var(--radius) var(--radius) 0 0; }
.spec-card--dim { border-color: var(--border); opacity: 0.65; }
.spec-card--dim::before { background: var(--text-dim); }
.spec-label { font-family: var(--mono); font-size: 0.8rem; font-weight: 700; color: var(--teal-light); margin-bottom: 6px; }
.spec-card--dim .spec-label { color: var(--text-muted); }
.spec-value { font-size: 0.85rem; color: var(--text); margin-bottom: 8px; font-weight: 600; }
.spec-note { font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); line-height: 1.4; }


/* ── 15. FIREWALL RULE LIST (aws-setup) ──────────────────── */

.rule-list { display: flex; flex-direction: column; gap: 2px; margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rule-item { display: grid; grid-template-columns: 200px 1fr; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.rule-item:last-child { border-bottom: none; }
.rule-port { padding: 14px 16px; font-family: var(--mono); font-size: 0.78rem; font-weight: 700; color: var(--teal-light); background: rgba(58,158,158,0.07); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; word-break: break-word; }
.rule-port span { font-size: 0.65rem; color: var(--text); font-weight: 400; letter-spacing: 0.04em; }
.rule-source { padding: 14px 16px; font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }
.rule-source strong { color: var(--text); }


/* ── 16. REVEAL ANIMATIONS ───────────────────────────────── */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }


/* ── 17. FOOTER ──────────────────────────────────────────── */

.site-footer { margin-left: var(--sidebar-w); border-top: 1px solid var(--border); padding: 44px 48px; text-align: center; background: var(--bg); }
.footer-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.footer-logo img { height: 34px; width: auto; opacity: 0.75; transition: opacity 0.2s; }
.footer-logo:hover img { opacity: 1; }
.footer-copy { font-family: var(--mono); font-size: 0.68rem; color: var(--text-dim); letter-spacing: 0.05em; }
.footer-back { font-family: var(--mono); font-size: 0.72rem; }
.footer-back a { color: var(--teal); }
.footer-back a:hover { color: var(--teal-light); }


/* ── 18. SCROLLBAR ───────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--teal-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }


/* ── 19. RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 900px) {
  :root { --sidebar-w: 190px; }
  .section-inner { padding: 60px 32px; }
}

@media (max-width: 700px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; z-index: 160; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  #site-nav { padding: 0 20px; }
  .nav-toggle { display: flex; }
  .content-wrap { margin-left: 0; padding: 0 0 60px; }
  .section-inner { padding: 50px 20px; }
  .hero { padding: calc(var(--nav-h) + 40px) 20px 60px; }
  .hero-scroll-hint { left: 50%; }
  .site-footer { margin-left: 0; padding: 40px 20px; }
}

@media (max-width: 580px) {
  .spec-grid { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  .rule-item { grid-template-columns: 1fr; }
  .rule-port { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── 20. Section Images ──────────────────────────────────────── */

/* Section illustration images */
.section-illustration {
  float: right;
  width: 260px;
  margin: 0 0 20px 32px;
  opacity: 0.92;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .section-illustration {
    float: none;
    display: block;
    width: 100%;
    max-width: 340px;
    margin: 0 auto 24px auto;
  }
}


/* ── 21. USER INPUT & FILE PATH HIGHLIGHTS ──────────────────── */

.user-input {
  background-color: rgba(100, 150, 200, 0.08);
  color: #2c5aa0;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: var(--mono);
  font-weight: 600;
  border: 1px solid rgba(100, 150, 200, 0.2);
}

.file-path {
  background-color: rgba(100, 150, 200, 0.08);
  color: #2c5aa0;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: var(--mono);
  font-weight: 600;
  border: 1px solid rgba(100, 150, 200, 0.2);
}


/* ── 22. CODE BLOCK LOCATION STYLING ────────────────────────── */

.code-location-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
  font-family: var(--mono);
  margin-bottom: 8px;
}

/* Local machine / Your Computer (green) */
.code-local,
.code-computer {
  border-left: 4px solid #28a745;
  background-color: rgba(40, 167, 69, 0.02);
}
.code-local .code-location-badge,
.code-computer .code-location-badge {
  background-color: rgba(40, 167, 69, 0.15);
  color: #165c3b;
}

/* AWS / Cloud server (teal) */
.code-aws {
  border-left: 4px solid var(--teal);
  background-color: rgba(58, 158, 158, 0.02);
}
.code-aws .code-location-badge {
  background-color: rgba(58, 158, 158, 0.15);
  color: #1a4a4a;
}

/* Discord portal (purple) */
.code-discord {
  border-left: 4px solid #7289DA;
  background-color: rgba(114, 137, 218, 0.02);
}
.code-discord .code-location-badge {
  background-color: rgba(114, 137, 218, 0.15);
  color: #4a5bb8;
}

/* Setup / Config files (orange) */
.code-setup {
  border-left: 4px solid #FF9800;
  background-color: rgba(255, 152, 0, 0.02);
}
.code-setup .code-location-badge {
  background-color: rgba(255, 152, 0, 0.15);
  color: #b35200;
}


/* ── 23. REUSABLE CONTENT CLASSES ───────────────────────────── */

/* Standard list styling used across sections */
.step-list {
  margin: 15px 0;
  padding-left: 20px;
  color: var(--text-muted);
}
.step-list li {
  margin-bottom: 6px;
  line-height: 1.65;
}

/* Ordered step list (same base as step-list) */
.step-list-ordered {
  margin: 15px 0;
  padding-left: 20px;
  color: var(--text-muted);
}
.step-list-ordered li {
  margin-bottom: 6px;
  line-height: 1.65;
}

/* Compact inline list with less spacing */
.step-list-compact {
  margin: 10px 0 10px 20px;
  color: var(--text-muted);
}
.step-list-compact li {
  margin-bottom: 4px;
  line-height: 1.55;
}

/* Note/highlight paragraph with left border */
.note-highlight {
  margin-top: 15px;
  padding: 12px;
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid #ffc107;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}