:root {
  --font-mono: 'Courier Prime', 'Courier New', monospace;
  --color-bg: #F8F4EF;
  --color-text: #1C1B19;
  --color-muted: #6C6863;
  --color-rule: #C7BFB7;
  --color-highlight: #F1ECE5;
  --color-highlight-border: #E9E2DA;
  --color-focus: #5D554C;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, strong { font-family: var(--font-mono); font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; background: var(--color-bg); padding: 6px 10px; z-index: 10; }

.page-shell {
  width: min(100% - 64px, 1280px);
  margin-inline: auto;
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 16px 22px;
  border-bottom: 1px solid var(--color-rule);
}
.site-name {
  margin: 0;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.site-name a { text-decoration: none; }
.site-globe { display: inline-block; width: 1.25em; height: 1.25em; margin-left: 0.4em; vertical-align: -0.28em; }
.site-nav { display: flex; align-items: center; gap: 36px; font-size: 14px; }
.site-nav a { text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; }
.nav-divider { width: 1px; height: 18px; background: var(--color-text); }
.lang-switch { display: flex; align-items: center; gap: 8px; color: var(--color-muted); }
.lang-switch a { color: var(--color-muted); }
.lang-switch .is-active { color: var(--color-text); font-weight: 700; text-decoration: underline; }
.menu-button { display: none; }

/* Sections */
.site-section {
  display: grid;
  grid-template-columns: minmax(225px, 280px) minmax(0, 1fr);
  column-gap: 34px;
  padding: 24px 16px;
  border-bottom: 1px solid var(--color-rule);
  scroll-margin-top: 16px;
}
.site-section:last-child { border-bottom: 0; padding-bottom: 48px; }
.site-section__heading {
  font-size: 22px;
  line-height: 1.22;
  margin: 0;
  letter-spacing: 0.02em;
}
.site-section__heading { max-width: 14ch; }
.site-section--contact .site-section__heading { max-width: none; }
/* Suomenkieliset otsikot ovat pidempiä: "Keihin haluaisin / tutustua", "Mikä minua / kiinnostaa" */
html[lang="fi"] .site-section__heading { max-width: 17ch; }
.site-section__body { max-width: 880px; }
.site-section__body > * + * { margin-top: 12px; }
.project-name { font-size: 16px; margin: 0; }
.project-name a { text-decoration: none; }
.project-name a:hover { text-decoration: underline; }
.project-name + * { margin-top: 6px; }

.site-section--people {
  border: 0;
  background: var(--color-highlight);
  border-radius: 14px;
  margin-block: 16px;
  padding: 24px 16px;
}
.site-section--divided .site-section__body {
  border-left: 1px solid var(--color-rule);
  padding-left: 30px;
  margin-left: -31px;
}
.site-section--contact { border-top: 1px solid var(--color-rule); }

.email-link span { display: inline-block; margin-left: 8px; text-decoration: none; font-size: 1.15em; }
.muted { color: var(--color-muted); }

/* My Thoughts */
.thoughts { max-width: 680px; padding: 32px 16px 56px; }
.thoughts h1 { font-size: 22px; margin: 0 0 16px; }
.thoughts-list { list-style: none; margin: 32px 0 0; padding: 0; }
.thoughts-list li { padding: 18px 0; border-top: 1px solid var(--color-rule); }
.thoughts-list h2 { font-size: 17px; margin: 0 0 4px; }
.thoughts-list a { text-decoration: none; }
.thoughts-list a:hover { text-decoration: underline; }
.thought-meta { color: var(--color-muted); font-size: 14px; margin: 0 0 8px; }
.post h1 { font-size: 24px; line-height: 1.25; margin: 24px 0 6px; }
.post-body { margin-top: 28px; }
.post-body > * + * { margin-top: 14px; }
.post-body h2 { font-size: 18px; margin-top: 28px; }
.post-body blockquote { margin-left: 0; padding-left: 16px; border-left: 2px solid var(--color-rule); }

@media (max-width: 999px) {
  .site-section { grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); column-gap: 28px; }
  .site-section--divided .site-section__body { margin-left: -15px; padding-left: 14px; }
}

@media (max-width: 800px) {
  body { font-size: 14px; line-height: 1.5; }
  .page-shell { width: auto; margin-inline: 20px; }
  .site-header { padding: 18px 0 16px; flex-wrap: wrap; }
  .site-name { font-size: 19px; }
  .js .menu-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin: -10px -10px -10px 0;
    padding: 10px;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--color-text);
  }
  .menu-button span { display: block; height: 2px; width: 22px; background: currentColor; }
  .site-nav {
    display: flex;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-top: 8px;
    font-size: 15px;
  }
  .js .site-nav:not(.is-open) { display: none; }
  .site-nav > a, .lang-switch { padding: 10px 0; }
  .nav-divider { display: none; }
  .lang-switch { gap: 12px; }
  .lang-switch a { padding: 4px 0; }

  .site-section { display: block; padding: 24px 0; }
  .site-section__heading, html[lang] .site-section__heading { font-size: 20px; margin-bottom: 14px; max-width: none; }
  .site-section--people { padding: 20px 18px; margin-block: 14px; }
  .site-section--divided .site-section__body { border-left: 0; padding-left: 0; margin-left: 0; }
  .thoughts { padding: 24px 0 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
