/* ==========================================================================
   Victor S. Gabel — personal site
   Design: "Ship's Log, Indexed" — dark nautical ledger + fixed index sidebar.
   This is a deliberate single-theme identity (not adaptive to light/dark).
   ========================================================================== */

:root {
  --bg: #0F1922;
  --panel: #152230;
  --panel-glass: rgba(21, 34, 48, 0.55);
  --text: #E8E1CC;
  --text-muted: rgba(232, 225, 204, 0.72);
  --sub: #93A0A8;
  --accent: #BD9862;
  --accent-ink: #0F1922;
  --rule: rgba(232, 225, 204, 0.10);

  --font-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  --font-mono: 'Courier New', Consolas, 'Liberation Mono', Menlo, monospace;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

body {
  margin: 0;
  background:
    radial-gradient(60rem 40rem at 15% -10%, rgba(189, 152, 98, 0.10), transparent 60%),
    radial-gradient(50rem 40rem at 100% 20%, rgba(147, 160, 168, 0.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------------- */
/* Shell layout: fixed index sidebar + scrolling main column               */
/* ---------------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: 20rem 1fr;
  min-height: 100vh;
}

@media (max-width: 780px) {
  .shell { grid-template-columns: 1fr; min-height: 0; }
}

.side {
  background: var(--panel-glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid var(--rule);
  padding: 2.2rem 1.7rem;
}

@media (max-width: 780px) {
  .side {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
}

.side-inner {
  position: sticky;
  top: 2.2rem;
}

@media (max-width: 780px) {
  .side-inner { position: static; }
}

.compass {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  border: 1px solid var(--accent);
  position: relative;
  margin-bottom: 1.3rem;
}

.compass::before,
.compass::after {
  content: "";
  position: absolute;
  background: var(--accent);
}

.compass::before { top: 50%; left: 10%; right: 10%; height: 1px; transform: translateY(-50%); }
.compass::after { left: 50%; top: 10%; bottom: 10%; width: 1px; transform: translateX(-50%); }

.site-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 0 0 .3rem;
}

.site-name a { text-decoration: none; color: var(--text); }

.tagline {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--sub);
  letter-spacing: .02em;
  line-height: 1.5;
  margin: 0 0 1.9rem;
}

.index-label {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .6rem;
}

.side-nav {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  font-size: .92rem;
}

.side-nav li { border-top: 1px solid var(--rule); }
.side-nav li:last-child { border-bottom: 1px solid var(--rule); }

.side-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: var(--text);
  padding: .65rem 0;
}

.side-nav a:hover,
.side-nav a[aria-current="page"] { color: var(--accent); }

.side-nav a::after {
  content: "\2192";
  color: var(--accent);
  opacity: 0;
  transition: opacity .15s ease;
}

.side-nav a:hover::after,
.side-nav a[aria-current="page"]::after { opacity: 1; }

.lang-switch {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
}

.lang-switch a {
  text-decoration: none;
  color: var(--sub);
  padding-bottom: 1px;
}

.lang-switch a[aria-current="true"] {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

.main {
  padding: 2.4rem 2.4rem 4rem;
  min-width: 0;
}

.main > * {
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 780px) {
  .main { padding: 2rem 1.5rem 3rem; }
}

.coord {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--sub);
  margin: 0 0 1.8rem;
}

/* ---------------------------------------------------------------------- */
/* Log entries                                                             */
/* ---------------------------------------------------------------------- */

.entry {
  border: 1px solid var(--rule);
  background: var(--panel-glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(232, 225, 204, 0.06), 0 20px 40px -24px rgba(0, 0, 0, 0.6);
  padding: 1.8rem 1.9rem;
  margin-bottom: 1.4rem;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .9rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--accent);
  text-transform: uppercase;
}

.entry h1,
.entry h2 {
  margin: 0 0 .8rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-wrap: balance;
}

.entry h1 { font-size: 1.55rem; }
.entry h2 { font-size: 1.25rem; }

.entry p {
  margin: 0 0 1rem;
  line-height: 1.75;
  max-width: 50rem;
  font-size: 17px;
  color: var(--text-muted);
}

.entry p:last-child { margin-bottom: 0; }

.entry-with-thumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.2rem;
}

.entry-with-thumb .entry-body { flex: 1; min-width: 0; }

.pub-thumb {
  position: relative;
  flex: none;
  width: 10rem;
  aspect-ratio: 4 / 3;
  transform: rotate(6deg);
}

.pub-thumb-glow {
  position: absolute;
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  object-fit: cover;
  object-position: top;
  filter: blur(22px) saturate(140%);
  opacity: .5;
}

.pub-thumb-img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border: 6px solid var(--panel);
  box-shadow: 0 18px 32px -16px rgba(0, 0, 0, .7);
}

@media (max-width: 780px) {
  .entry-with-thumb {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.4rem;
  }
  .pub-thumb {
    width: 8rem;
    align-self: center;
    transform: rotate(4deg);
  }
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--sub);
  margin-top: .3rem;
}

.keywords span::before { content: "\2014 "; color: var(--accent); }

.cta {
  display: inline-block;
  margin-top: .5rem;
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  background: rgba(189, 152, 98, 0.08);
  padding: .55rem 1.05rem;
  transition: background .15s ease, color .15s ease;
}

.cta:hover { background: var(--accent); color: var(--accent-ink); }

.cta[aria-disabled="true"] {
  color: var(--sub);
  border-color: var(--rule);
  cursor: not-allowed;
}

.cta[aria-disabled="true"]:hover { background: none; color: var(--sub); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.3rem;
  font-family: var(--font-ui);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .4rem;
}

.contact-value {
  margin: 0;
  font-size: .9rem;
  font-family: var(--font-serif);
}

.contact-value a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.contact-value a:hover { border-color: var(--accent); }

.source-link {
  margin: .9rem 0 0;
  font-size: .85rem;
  font-family: var(--font-ui);
}

.source-link a {
  color: var(--sub);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.source-link a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------------- */
/* Python course page                                                      */
/* ---------------------------------------------------------------------- */

.page-head {
  margin-bottom: 2.2rem;
}

.page-head .index-label { margin-bottom: .7rem; }

.page-head h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.2rem);
  margin: 0 0 .6rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.page-head .subtitle {
  color: var(--sub);
  font-style: italic;
  margin: 0;
  max-width: 40rem;
}

.intro p {
  max-width: 42rem;
  line-height: 1.75;
  margin: 0 0 1.1rem;
  color: var(--text-muted);
}

.lessons-heading {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  border-top: 1px solid var(--rule);
  padding-top: 1.6rem;
  margin: 2.2rem 0 1.4rem;
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-top: 1.4rem;
  margin-top: 2rem;
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--sub);
}
