/* ============================================================
   Karri Ojanen — Portfolio site
   Tokens
   ============================================================ */

:root {
  --ink: #16212B;
  --ink-soft: #2C3A44;
  --muted: #5C6661;
  --paper: #F1F2EE;
  --paper-raised: #FFFFFF;
  --line: #D7D9D2;
  --baltic: #28465B;
  --baltic-deep: #1C3344;
  --ochre: #B8763E;
  --ochre-soft: #E8D2B5;
  --ochre-text: #8C5527;

  --font-display: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-quote: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --max-width: 1080px;
  --gutter: clamp(24px, 6vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--baltic);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { border-color: var(--ochre); color: var(--baltic-deep); }

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ============================================================
   Header / Nav
   ============================================================ */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(241, 242, 238, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  border-bottom: none;
}
.brand:hover { color: var(--baltic-deep); border-bottom: none; }
.brand .dot { color: var(--ochre-text); }

nav.primary-nav {
  display: flex;
  gap: 28px;
}

nav.primary-nav a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
}

nav.primary-nav a:hover,
nav.primary-nav a[aria-current="page"] {
  color: var(--baltic);
  border-bottom-color: var(--ochre);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 640px) {
  nav.primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    display: none;
  }
  nav.primary-nav.open { display: flex; }
  nav.primary-nav a {
    padding: 14px var(--gutter);
    border-bottom: 1px solid var(--line);
  }
  .nav-toggle { display: block; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding: clamp(48px, 8vw, 88px) 0 clamp(40px, 6vw, 72px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: clamp(32px, 6vw, 64px);
  align-items: start;
}

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 220px; }
}

.hero-eyebrow { margin-bottom: 18px; }

.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  font-weight: 700;
}

.hero-subhead {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-intro {
  margin-top: 28px;
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-photo-frame {
  border: 1px solid var(--line);
  padding: 10px;
  background: var(--paper-raised);
  border-radius: 2px;
}

.hero-photo-frame img {
  width: 100%;
  height: auto;
  border-radius: 1px;
  filter: grayscale(8%);
}

/* ============================================================
   Skills (keyword chips)
   ============================================================ */

.skills-section { padding: clamp(8px, 2vw, 16px) 0 clamp(32px, 5vw, 56px); }

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.skill-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
}

/* ============================================================
   Pillars (signature element: connecting line + nodes)
   ============================================================ */

.pillars-section { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }

.pillars-line-wrap {
  position: relative;
  padding-left: 6px;
}

.pillars-line-wrap::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line);
}

.pillars-line-wrap .line-fill {
  position: absolute;
  left: 12px;
  top: 10px;
  width: 2px;
  height: 0%;
  background: var(--ochre);
  transition: height 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pillars-line-wrap.in-view .line-fill { height: calc(100% - 20px); }

.pillar {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: clamp(20px, 4vw, 32px);
  padding-bottom: clamp(36px, 5vw, 52px);
  margin-bottom: clamp(36px, 5vw, 52px);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.pillars-line-wrap.in-view .pillar { opacity: 1; transform: translateY(0); }
.pillar:nth-of-type(1) { transition-delay: 0.05s; }
.pillar:nth-of-type(2) { transition-delay: 0.3s; }
.pillar:nth-of-type(3) { transition-delay: 0.55s; }
.pillar:nth-of-type(4) { transition-delay: 0.8s; }

.pillar:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.pillar-node {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ochre);
}

.pillar-content {
  flex: 1 1 auto;
  min-width: 0;
}

.pillar h3 {
  font-size: 23px;
  margin-bottom: 12px;
}

.pillar p {
  color: var(--ink-soft);
  max-width: 62ch;
}

.pillar-quote {
  margin-top: 20px;
  padding-left: 18px;
  border-left: 2px solid var(--ochre-soft);
}

.pillar-quote p {
  font-family: var(--font-quote);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  max-width: 58ch;
}

.pillar-quote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.pillar-quote cite strong { color: var(--ink-soft); font-weight: 600; }

/* ============================================================
   Page header (Writing / Impact / Contact)
   ============================================================ */

.page-header {
  padding: clamp(48px, 8vw, 80px) 0 clamp(28px, 4vw, 40px);
}

.page-header h1 {
  font-size: clamp(30px, 4vw, 42px);
}

.page-header .lede {
  margin-top: 16px;
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ============================================================
   Writing page
   ============================================================ */

.writing-group { padding-bottom: clamp(36px, 5vw, 52px); }
.writing-group .eyebrow { margin-bottom: 18px; }

.writing-entry {
  display: block;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.writing-group:first-of-type .writing-entry:first-of-type { border-top: 1px solid var(--line); }

.writing-entry-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.writing-entry-title .arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ochre-text);
  flex-shrink: 0;
}

.writing-entry p {
  margin-top: 8px;
  color: var(--muted);
  max-width: 64ch;
}

a.writing-entry-link { border-bottom: none; }
a.writing-entry-link:hover .writing-entry-title { color: var(--baltic-deep); }
a.writing-entry-link:hover .writing-entry-title .arrow { color: var(--baltic-deep); }

/* ============================================================
   Impact page
   ============================================================ */

.impact-story {
  padding: clamp(28px, 4vw, 40px) 0;
  border-top: 1px solid var(--line);
}
.impact-story:first-of-type { border-top: 1px solid var(--line); }

.impact-story h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.impact-story p {
  color: var(--ink-soft);
  max-width: 64ch;
}

/* ============================================================
   Contact page
   ============================================================ */

.contact-section {
  padding: clamp(40px, 8vw, 72px) 0 clamp(64px, 10vw, 100px);
  text-align: left;
}

.contact-section h1 {
  font-size: clamp(30px, 4vw, 42px);
  margin-bottom: 18px;
}

.contact-section .lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 36px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn.primary {
  background: var(--baltic);
  border-color: var(--baltic);
  color: #fff;
}
.btn.primary:hover { background: var(--baltic-deep); border-color: var(--baltic-deep); }

/* ============================================================
   Footer
   ============================================================ */

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--gutter);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--baltic); }
