/* =====================================================================
   Dashboardesk.com — Java Practical Guide
   Shared stylesheet (day/night mode, responsive, large readable type)
   ===================================================================== */

/* ---------- 0. Self-hosted web fonts (no third-party requests) ---------- */
/* Inter (400, 500, 600, 700, 800) — body font */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Inter-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Inter-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/Inter-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/Inter-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* JetBrains Mono (400, 500, 600) — code font */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/JetBrains-Mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/JetBrains-Mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/JetBrains-Mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/JetBrains-Mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/JetBrains-Mono-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/JetBrains-Mono-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 1. Design tokens & theme ---------- */
:root {
  /* Brand palette */
  --brand:        #E76F00;          /* Java orange */
  --brand-dark:   #B8530A;
  --brand-soft:   #FFE7D5;

  /* Day theme (default) */
  --bg:           #FFFFFF;
  --bg-soft:      #F7F8FA;
  --bg-elevated:  #FFFFFF;
  --bg-code:      #F4F4F6;
  --bg-code-header:#ECECEF;
  --text:         #1F2328;
  --text-muted:   #57606A;
  --text-soft:    #6E7781;
  --border:       #E1E4E8;
  --border-soft:  #ECEEF1;
  --link:         #B8530A;
  --link-hover:   #7A3706;
  --accent:       #1E6BB8;
  --success:      #1A7F37;
  --warning:      #BF8700;
  --danger:       #CF222E;
  --shadow:       0 1px 3px rgba(31,35,40,.08), 0 4px 12px rgba(31,35,40,.04);
  --shadow-lg:    0 8px 24px rgba(31,35,40,.12);

  /* Typography */
  --font-body:    "Inter", "Segoe UI", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-base:      17px;            /* large base for easy reading */
  --fs-sm:        14px;
  --fs-xs:        12.5px;
  --fs-h1:        2.05rem;
  --fs-h2:        1.55rem;
  --fs-h3:        1.22rem;
  --fs-h4:        1.02rem;

  /* Layout */
  --container:   1180px;
  --radius:      8px;
  --radius-sm:   5px;
  --header-h:    64px;
}

[data-theme="night"] {
  --bg:           #0D1117;
  --bg-soft:      #161B22;
  --bg-elevated:  #1C2128;
  --bg-code:      #161B22;
  --bg-code-header:#21262D;
  --text:         #E6EDF3;
  --text-muted:   #9DA7B3;
  --text-soft:    #8B949E;
  --border:       #30363D;
  --border-soft:  #21262D;
  --link:         #FFA657;
  --link-hover:   #FFC580;
  --accent:       #58A6FF;
  --success:      #3FB950;
  --warning:      #D29922;
  --danger:       #F85149;
  --brand-soft:   #3A1F0E;
  --shadow:       0 1px 3px rgba(0,0,0,.4);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.5);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .25s ease, color .25s ease;
}
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--link-hover); text-decoration: underline; }
h1, h2, h3, h4, h5 { color: var(--text); line-height: 1.3; margin: 1.6em 0 .6em; font-weight: 700; }
h1 { font-size: var(--fs-h1); letter-spacing: -.02em; }
h2 { font-size: var(--fs-h2); letter-spacing: -.01em; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
p, ul, ol { margin: 0 0 1.05em; }
ul, ol { padding-left: 1.5em; }
li { margin: .25em 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- 3. Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff; padding: 10px 18px; z-index: 9999; border-radius: 0 0 6px 0; }
.skip-link:focus { left: 0; }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.site-header .container { display: flex; align-items: center; height: 100%; gap: 18px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo .logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 2px 6px rgba(231,111,0,.35);
  font-family: var(--font-mono);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text small { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: .03em; }

.main-nav { display: flex; gap: 4px; margin-left: 12px; }
.main-nav a {
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 15px;
}
.main-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.main-nav a.active { color: var(--brand); background: var(--brand-soft); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  width: 220px;
}
.search-box input {
  border: 0; background: transparent; outline: none;
  color: var(--text); font: inherit; font-size: 14px; width: 100%;
}
.search-box svg { color: var(--text-soft); flex-shrink: 0; }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, transform .15s, color .15s;
}
.theme-toggle:hover { background: var(--bg-code); transform: rotate(-12deg); }
.theme-toggle .icon-moon { display: none; }
[data-theme="night"] .theme-toggle .icon-sun { display: none; }
[data-theme="night"] .theme-toggle .icon-moon { display: block; }

.mobile-toggle {
  display: none;
  width: 38px; height: 38px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  cursor: pointer; place-items: center;
}
.mobile-toggle svg { width: 22px; height: 22px; }

/* ---------- 5. Footer ---------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 60px;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 36px;
}
.footer-brand .logo { margin-bottom: 14px; }
.footer-brand p { font-size: 14.5px; color: var(--text-muted); max-width: 320px; }
.footer-col h4 { font-size: 13px; color: var(--text); margin: 0 0 12px; text-transform: uppercase; letter-spacing: .05em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 7px 0; }
.footer-col a { color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13.5px;
}
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text-muted);
}
.footer-social a:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- 6. Hero ---------- */
.hero {
  padding: 56px 0 44px;
  background:
    radial-gradient(ellipse at top right, var(--brand-soft), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.6rem; margin-top: 0; letter-spacing: -.025em; }
.hero h1 .accent { color: var(--brand); }
.hero p.lead { font-size: 1.18rem; color: var(--text-muted); margin-bottom: 1.6em; max-width: 600px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 600; font-size: 15px;
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand-dark); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(231,111,0,.35); }
.btn-outline { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-soft); color: var(--text); border-color: var(--brand); }

.hero-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
}
.hero-card .code-tab {
  display: flex; gap: 5px; margin-bottom: 14px;
}
.hero-card .code-tab span {
  width: 11px; height: 11px; border-radius: 50%; background: var(--border);
}
.hero-card .code-tab span:nth-child(1){ background: #FF5F57; }
.hero-card .code-tab span:nth-child(2){ background: #FEBC2E; }
.hero-card .code-tab span:nth-child(3){ background: #28C840; }
.hero-card pre { margin: 0; font-size: 14px; background: transparent; padding: 0; }

/* ---------- 7. Section headings ---------- */
.section { padding: 48px 0; }
.section-head { margin-bottom: 30px; }
.section-head .eyebrow { color: var(--brand); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.section-head h2 { border: 0; padding: 0; margin: 6px 0 8px; font-size: 1.85rem; }
.section-head p { color: var(--text-muted); max-width: 720px; margin: 0; }

/* ---------- 8. Cards grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; gap: 10px;
  height: 100%;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.card .card-icon {
  width: 44px; height: 44px;
  background: var(--brand-soft); color: var(--brand-dark);
  border-radius: 10px;
  display: grid; place-items: center; font-size: 22px;
}
[data-theme="night"] .card .card-icon { color: var(--brand); }
.card h3 { margin: 0; font-size: 1.1rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.card .card-meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-soft); display: flex; justify-content: space-between; }
.card a.card-link { color: var(--text); }
.card a.card-link:hover { text-decoration: none; color: var(--brand); }
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; background: var(--bg-code); color: var(--text-muted);
}
.tag-beginner { background: #E6F4EA; color: #1A7F37; }
.tag-intermediate { background: #FFF8C5; color: #9A6700; }
.tag-advanced { background: #FFD8D5; color: #CF222E; }
[data-theme="night"] .tag-beginner { background: rgba(63,185,80,.15); color: #3FB950; }
[data-theme="night"] .tag-intermediate { background: rgba(210,153,34,.15); color: #D29922; }
[data-theme="night"] .tag-advanced { background: rgba(248,81,73,.15); color: #F85149; }

/* ---------- 9. Tutorials sidebar layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  padding: 36px 0;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
}
.sidebar h4 { margin: 18px 0 10px; font-size: 12.5px; }
.sidebar h4:first-child { margin-top: 0; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin: 0; }
.sidebar a {
  display: block; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14.5px;
}
.sidebar a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
[data-theme="night"] .sidebar a.active { color: var(--brand); }

/* ---------- 10. Article content ---------- */
.article { max-width: 820px; }
.article-header { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-header .breadcrumb { font-size: 13px; color: var(--text-soft); margin-bottom: 12px; }
.article-header .breadcrumb a { color: var(--text-soft); }
.article-header h1 { margin: 0 0 12px; font-size: 2.1rem; }
.article-header .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-soft); font-size: 13.5px; }
.article-header .meta span { display: inline-flex; align-items: center; gap: 5px; }
.article-header .meta .tag { color: var(--text-muted); }

.article h2 { margin-top: 2.2em; }
.article h3 { margin-top: 1.8em; }
.article p, .article li { font-size: 16.5px; }
.article img { border-radius: var(--radius); border: 1px solid var(--border); margin: 1.4em 0; }
.article a { font-weight: 500; }

/* ---------- 11. Code blocks ---------- */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5em 0;
  overflow: hidden;
  position: relative;
}
.code-block .code-header {
  background: var(--bg-code-header);
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.code-block .copy-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  font-size: 11.5px; padding: 3px 9px; border-radius: 4px; cursor: pointer;
  transition: all .15s;
}
.code-block .copy-btn:hover { color: var(--brand); border-color: var(--brand); }
.code-block .copy-btn.copied { color: var(--success); border-color: var(--success); }
.code-block pre {
  margin: 0; padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.65;
  overflow-x: auto;
  color: var(--text);
}
.code-block :is(pre, code) { background: transparent; }
pre { background: var(--bg-code); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; }
code {
  font-family: var(--font-mono);
  font-size: .92em;
  background: var(--bg-code);
  color: var(--text);
  padding: .12em .4em;
  border-radius: 4px;
  font-weight: 500;
}
pre code { background: transparent; padding: 0; }

/* Java syntax highlighting */
.tok-kw  { color: #D6724C; font-weight: 600; }       /* keywords */
.tok-str { color: #4E9A06; }                          /* strings */
.tok-num { color: #8F5902; }                          /* numbers */
.tok-cmt { color: #6A737D; font-style: italic; }      /* comments */
.tok-typ { color: #4E9A06; font-weight: 600; }        /* types */
.tok-cls { color: #4183C4; }                           /* class names */
.tok-fn  { color: #6F42C1; }                           /* functions */
[data-theme="night"] .tok-kw  { color: #FFA657; }
[data-theme="night"] .tok-str { color: #7EE787; }
[data-theme="night"] .tok-num { color: #F0883E; }
[data-theme="night"] .tok-cmt { color: #8B949E; }
[data-theme="night"] .tok-cls { color: #79C0FF; }
[data-theme="night"] .tok-fn  { color: #D2A8FF; }

/* Inline code within text */
p > code, li > code { font-size: .9em; }

/* ---------- 12. Callouts ---------- */
.callout {
  border-left: 3px solid;
  padding: 12px 18px;
  margin: 1.4em 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-soft);
  font-size: 15.5px;
}
.callout p:last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.callout-info    { border-color: var(--accent); background: rgba(30,107,184,.07); }
.callout-success { border-color: var(--success); background: rgba(26,127,55,.07); }
.callout-warning { border-color: var(--warning); background: rgba(191,135,0,.07); }
.callout-danger  { border-color: var(--danger);  background: rgba(207,34,46,.07); }
[data-theme="night"] .callout-info    { background: rgba(88,166,255,.10); }
[data-theme="night"] .callout-success { background: rgba(63,185,80,.10); }
[data-theme="night"] .callout-warning { background: rgba(210,153,34,.10); }
[data-theme="night"] .callout-danger  { background: rgba(248,81,73,.10); }

/* ---------- 13. Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.4em 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
table th, table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table th { background: var(--bg-soft); font-weight: 700; color: var(--text); font-size: 13.5px; }
table tr:last-child td { border-bottom: 0; }
table tr:hover td { background: var(--bg-soft); }

/* ---------- 14. Article pagination (prev/next) ---------- */
.prev-next {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 44px 0 16px; padding-top: 26px;
  border-top: 1px solid var(--border);
}
.prev-next a {
  display: block; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated); transition: all .15s;
}
.prev-next a:hover { border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.prev-next .pn-label { font-size: 12.5px; color: var(--text-soft); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.prev-next .pn-title { font-weight: 600; color: var(--text); }
.prev-next .next { text-align: right; }

/* ---------- 15. Path / track cards ---------- */
.track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.track {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; position: relative; overflow: hidden;
  transition: all .2s;
}
.track:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.track .track-num { position: absolute; top: -10px; right: 14px; font-size: 5rem; color: var(--brand-soft); font-weight: 800; font-family: var(--font-mono); }
[data-theme="night"] .track .track-num { color: rgba(255,166,87,.12); }
.track h3 { margin: 0 0 8px; font-size: 1.3rem; }
.track p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 16px; }
.track ul { font-size: 14px; color: var(--text-muted); padding-left: 1.2em; }
.track ul li { margin: 4px 0; }

/* ---------- 16. FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px; cursor: pointer; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  color: var(--text); font-size: 15.5px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; color: var(--brand); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 20px 18px; color: var(--text-muted); font-size: 15px; }

/* ---------- 17. CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-radius: 14px;
  padding: 36px;
  text-align: center;
  margin: 40px 0;
  box-shadow: 0 8px 24px rgba(231,111,0,.25);
}
.cta-banner h2 { color: #fff; border: 0; padding: 0; margin: 0 0 10px; }
.cta-banner p { color: rgba(255,255,255,.92); margin-bottom: 20px; }
.cta-banner .btn-primary { background: #fff; color: var(--brand-dark); }
.cta-banner .btn-primary:hover { background: #fff; color: var(--brand); }

/* ---------- 18. Page header (non-tutorial) ---------- */
.page-header {
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  padding: 44px 0 30px;
}
.page-header h1 { margin: 0 0 8px; font-size: 2.1rem; }
.page-header p { margin: 0; color: var(--text-muted); font-size: 1.05rem; max-width: 680px; }

/* ---------- 19. Forms (Contact) ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font: inherit; font-size: 15px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-group textarea { min-height: 130px; resize: vertical; }

/* ---------- 20. Legal pages ---------- */
.legal-body { max-width: 820px; margin: 0 auto; padding: 36px 0; }
.legal-body h2 { margin-top: 2.2em; }
.legal-body .toc { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 22px; margin: 24px 0 36px; }
.legal-body .toc h4 { margin: 0 0 8px; }
.legal-body .toc ol { margin: 0; padding-left: 1.4em; font-size: 14.5px; }
.legal-body .last-updated { color: var(--text-soft); font-size: 13.5px; margin-bottom: 24px; }

/* ---------- 21. Pills & misc utilities ---------- */
.pill { display: inline-block; padding: 2px 10px; background: var(--brand-soft); color: var(--brand-dark); border-radius: 12px; font-size: 12.5px; font-weight: 600; }
[data-theme="night"] .pill { color: var(--brand); }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.flex { display: flex; gap: 12px; align-items: center; }
.no-bullet { list-style: none; padding: 0; }

/* ---------- 22. 404 ---------- */
.notfound { text-align: center; padding: 80px 0; }
.notfound .big-num { font-size: 7rem; font-weight: 800; color: var(--brand); line-height: 1; font-family: var(--font-mono); }

/* ---------- 23. Back-to-top ---------- */
#backToTop {
  position: fixed; right: 24px; bottom: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand); color: #fff;
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s, transform .2s;
  box-shadow: var(--shadow-lg); z-index: 90;
}
#backToTop.show { opacity: 1; visibility: visible; }
#backToTop:hover { transform: translateY(-3px); }

/* ---------- 24. Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --fs-base: 16.5px; --fs-h1: 1.85rem; --fs-h2: 1.4rem; }
  .main-nav, .search-box { display: none; }
  .mobile-toggle { display: grid; }
  .main-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    padding: 10px 20px; gap: 4px; box-shadow: var(--shadow-lg);
  }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .prev-next { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.1rem; }
  .section { padding: 36px 0; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .logo-text small { display: none; }
  .header-actions .theme-toggle { width: 34px; height: 34px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- 25. Cookie consent banner ---------- */
.cookie-consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(31,35,40,.18), 0 2px 8px rgba(31,35,40,.08);
  padding: 18px 22px;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  animation: cookie-slide-up .35s ease-out;
}
.cookie-consent.show { display: flex; }
.cookie-consent .cc-icon {
  width: 36px; height: 36px;
  background: var(--brand-soft); color: var(--brand-dark);
  border-radius: 9px; display: grid; place-items: center;
  flex-shrink: 0;
}
[data-theme="night"] .cookie-consent .cc-icon { color: var(--brand); }
.cookie-consent .cc-text { flex: 1 1 320px; min-width: 0; }
.cookie-consent .cc-text strong { font-weight: 600; color: var(--text); }
.cookie-consent .cc-text a { color: var(--link); text-decoration: underline; }
.cookie-consent .cc-text a:hover { color: var(--link-hover); }
.cookie-consent .cc-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  flex-shrink: 0;
}
.cookie-consent .cc-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 8px 14px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.cookie-consent .cc-btn:hover { background: var(--bg-soft); border-color: var(--text-soft); }
.cookie-consent .cc-btn.cc-accept {
  background: var(--brand); color: #fff; border-color: var(--brand-dark);
}
.cookie-consent .cc-btn.cc-accept:hover { background: var(--brand-dark); }
.cookie-consent .cc-btn.cc-reject { color: var(--text-muted); }
.cookie-consent .cc-link { font-size: 13px; color: var(--text-soft); text-decoration: underline; }
.cookie-consent .cc-link:hover { color: var(--link); }

@keyframes cookie-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Compact cookie bar (already-decided state, shown on revisit if user wants to change) */
.cookie-reopen {
  position: fixed; left: 16px; bottom: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  font-size: 12.5px; color: var(--text-muted);
  cursor: pointer; box-shadow: var(--shadow);
  display: none; align-items: center; gap: 6px;
  z-index: 999;
}
.cookie-reopen.show { display: inline-flex; }
.cookie-reopen:hover { color: var(--brand); border-color: var(--brand); }
.cookie-reopen .cc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

@media (max-width: 600px) {
  .cookie-consent { left: 8px; right: 8px; bottom: 8px; padding: 14px 16px; }
  .cookie-consent .cc-text { flex: 1 1 100%; }
  .cookie-consent .cc-actions { width: 100%; }
  .cookie-consent .cc-btn { flex: 1; }
}
@media print {
  .cookie-consent, .cookie-reopen { display: none !important; }
}

