/* ---------------------------------------------------------------------------
   pekkakoskinen.com
   Three type roles, all from the system: Georgia for display, the platform UI
   face for reading, a monospace for labels and data. Nothing is downloaded.
   --------------------------------------------------------------------------- */

:root {
  --paper: #f7f7f4;
  --paper-raised: #ffffff;
  --ink: #15181b;
  --ink-muted: #5a6068;
  --rule: #dedcd4;
  --accent: #14513f;
  --accent-ink: #ffffff;
  --accent-wash: #d3e2da;

  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 62ch;
  --page: 68rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --section-space: clamp(4rem, 9vw, 7.5rem);

  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101312;
    --paper-raised: #171b1a;
    --ink: #eceee9;
    --ink-muted: #98a09c;
    --rule: #2a302d;
    --accent: #6fbf9f;
    --accent-ink: #0d1211;
    --accent-wash: #24382f;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
}

.skip-link:focus {
  left: 0;
}

/* --- Shared type roles --------------------------------------------------- */

.lede {
  max-width: var(--measure);
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  color: var(--ink-muted);
}

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.button--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.masthead__name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.masthead__nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.masthead__nav a {
  text-decoration: none;
}

.masthead__nav a:hover {
  color: var(--ink);
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 7rem) var(--gutter) var(--section-space);
}

.hero__headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero__role {
  margin: 0.6rem 0 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__portrait {
  margin: 0;
  width: clamp(7rem, 14vw, 10.5rem);
}

.hero__portrait img {
  display: block;
  width: 100%;
  border-radius: 50%;
  background: var(--paper-raised);
}

@media (max-width: 44rem) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero__portrait {
    order: -1;
  }
}

/* --- Sections ------------------------------------------------------------ */

.section {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--section-space) var(--gutter);
  border-top: 1px solid var(--rule);
}

.section__head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.section__intro {
  max-width: var(--measure);
  margin: 0;
  color: var(--ink-muted);
}

/* --- The companies ------------------------------------------------------ */

.companies {
  list-style: none;
  margin: 0;
  padding: 0;
}

.company {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 0.5rem 2.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
}

.company:last-child {
  border-bottom: 1px solid var(--rule);
}

.company__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.2;
}

.company__dates {
  margin: 0.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.company__social {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.company__note {
  max-width: var(--measure);
  margin: 0;
}

@media (max-width: 44rem) {
  .company {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* --- Body copy ----------------------------------------------------------- */

.prose {
  max-width: var(--measure);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
}

.prose p {
  margin: 0 0 1.25rem;
}

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

/* --- Contact ------------------------------------------------------------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 44rem) {
  .contact {
    grid-template-columns: 1fr;
  }
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.field label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  border-radius: 0;
}

.field textarea {
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--accent);
}

.field--trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile {
  margin-bottom: 1.25rem;
}

.form__status {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  min-height: 1.5em;
}

.form__status[data-state="error"] {
  color: #b3261e;
}

@media (prefers-color-scheme: dark) {
  .form__status[data-state="error"] {
    color: #f2b8b5;
  }
}

.form__status[data-state="sent"] {
  color: var(--accent);
}

.elsewhere h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.elsewhere ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

/* --- Colophon ------------------------------------------------------------ */

.colophon {
  max-width: var(--page);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.colophon p {
  margin: 0;
}

/* --- Consent ------------------------------------------------------------- */

.consent {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 20;
  max-width: 34rem;
  margin-inline: auto;
  padding: 1.25rem 1.4rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  box-shadow: 0 8px 30px rgb(0 0 0 / 12%);
}

.consent[hidden] {
  display: none;
}

.consent__text {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --- Motion -------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
