/* ============================================================
   EngmanMedia | style.css
   Independent Finnish media and expertise brand.
   Near-black graphite, warm orange accent, editorial typography.
   No external fonts. No frameworks.
   ============================================================ */

/* ------------------------------------------------------------
   1. Design tokens
   Edit the accent color here to match the final logo exactly.
   ------------------------------------------------------------ */
:root {
  /* Color */
  --bg:            #0e0f10;   /* graphite, not pure black          */
  --bg-raised:     #151719;   /* raised panels and alternating bands */
  --bg-card:       #1a1d1f;   /* cards                              */
  --border:        #26292c;   /* subtle borders                     */
  --border-strong: #34383c;
  --text:          #f4f2ee;   /* warm white                         */
  --text-dim:      #a49e94;   /* warm gray                          */
  --accent:        #f26b1d;   /* EngmanMedia orange (adjust to logo)*/
  --accent-soft:   rgba(242, 107, 29, 0.14);

  /* Type: system stacks only, no external fonts, no layout shift */
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "Cascadia Mono", Consolas,
                  "Liberation Mono", monospace;

  /* Rhythm */
  --space-section: clamp(5rem, 12vw, 9rem);
  --wrap-max: 1120px;
  --radius: 4px;
}

/* ------------------------------------------------------------
   2. Reset and base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; }

p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--text); }

ul, ol { margin: 0 0 1.25rem; padding-left: 1.25rem; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #0e0f10;
  padding: 0.6rem 1rem;
  z-index: 100;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   3. Layout primitives
   ------------------------------------------------------------ */
.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

.wrap-narrow { max-width: 760px; }
.wrap-narrow-left { max-width: 680px; }

.section { padding: var(--space-section) 0; }
.section-raised { background: var(--bg-raised); }

.center { text-align: center; }

/* Eyebrow labels: the monospace documentary voice of the site */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.lede {
  font-size: clamp(1.125rem, 2vw, 1.3rem);
  color: var(--text-dim);
  max-width: 46ch;
}

/* ------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease,
              color 0.2s ease, transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #0e0f10;
}
.btn-primary:hover { background: #ff7c2e; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------
   5. Header and navigation
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 15, 16, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
  margin: 0;
}
.wordmark-accent { color: var(--accent); }

.site-nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.site-nav a:not(.btn):hover { color: var(--text); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

/* Language selector: EN | FI text labels, no flags */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}
.lang-switch a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.5rem 0.15rem; /* generous tap target */
  transition: color 0.2s ease;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] { color: var(--accent); }
.lang-sep { color: var(--border-strong); }

.nav-toggle { display: none; }

/* Mobile navigation */
@media (max-width: 860px) {
  .site-nav {
    position: fixed;
    inset: 4.25rem 0 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem clamp(1.25rem, 5vw, 2.5rem);
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .site-nav.is-open { transform: translateX(0); }

  .site-nav ul {
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
  }
  .site-nav a:not(.btn) { font-size: 1.25rem; }
  .nav-cta { margin-top: auto; width: 100%; text-align: center; }

  /* On mobile the switcher stays visible in the header bar,
     between the wordmark and the menu toggle */
  .lang-switch { margin-left: auto; margin-right: 0.5rem; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
  }
  .nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s ease;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
    transform: translateY(4px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }
}

/* ------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------ */
.hero { padding: clamp(4.5rem, 10vw, 7.5rem) 0 0; }

.hero-heading {
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.hero-sub {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-dim);
  max-width: 58ch;
  margin-top: 1.5rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2.25rem 0 clamp(3rem, 7vw, 5rem);
}

/* ------------------------------------------------------------
   7. Image placeholder system ("test log" plates)
   Labeled, intentional frames instead of broken images or stock.
   Swap each for a real <img> with the same wrapper class later.
   ------------------------------------------------------------ */
.ph { margin: 0; }

.ph-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.4rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0 14px,
      rgba(255, 255, 255, 0.015) 14px 15px
    ),
    var(--bg-card);
}

/* Orange corner ticks: the documentary framing device */
.ph-frame::before,
.ph-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
}
.ph-frame::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
}
.ph-frame::after {
  bottom: -1px; right: -1px;
  border-width: 0 2px 2px 0;
}

.ph-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.ph-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 36ch;
}

.ph-hero .ph-frame  { aspect-ratio: 21 / 9;  min-height: 240px; }
.ph-wide .ph-frame  { aspect-ratio: 16 / 7;  min-height: 200px; margin-top: 3rem; }
.ph-tall .ph-frame  { aspect-ratio: 4 / 5;   min-height: 320px; }
.ph-portrait .ph-frame { aspect-ratio: 4 / 5; min-height: 320px; }

/* ------------------------------------------------------------
   7b. Final photographs (real images inside the plate frames)
   The orange corner ticks stay: they are the brand's framing
   device, carried from the placeholder system to the photos.
   Tune object-position per photo below if a crop needs moving.
   ------------------------------------------------------------ */
.ph-media {
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
}
.ph-media::before,
.ph-media::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
  z-index: 1;
}
.ph-media::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.ph-media::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.ph-media picture,
.ph-media img { display: block; width: 100%; height: 100%; }
.ph-media img { object-fit: cover; }

/* Hero: 21:9 editorial crop on desktop, native 3:2 on small screens
   so the vehicle and person are never squeezed on mobile */
.ph-hero .ph-media { aspect-ratio: 21 / 9; }
.ph-hero .ph-media img { object-position: 50% 58%; }
@media (max-width: 860px) {
  .ph-hero .ph-media { aspect-ratio: 3 / 2; }
  .ph-hero .ph-media img { object-position: 50% 50%; }
}

/* Long-Term Test conditions: wide 16:7 on desktop, 3:2 on mobile */
.ph-wide .ph-media { aspect-ratio: 16 / 7; margin-top: 3rem; }
.ph-wide .ph-media img { object-position: 50% 60%; }
@media (max-width: 640px) {
  .ph-wide .ph-media { aspect-ratio: 3 / 2; }
  .ph-wide .ph-media img { object-position: 50% 50%; }
}

/* Portraits: source photos are native 4:5, so no cropping occurs */
.ph-tall .ph-media,
.ph-portrait .ph-media { aspect-ratio: 4 / 5; }

.ph-hero {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem) var(--space-section);
}

/* ------------------------------------------------------------
   8. Two commercial paths (media-led: Media panel is larger)
   ------------------------------------------------------------ */
.paths { padding-bottom: var(--space-section); }

.paths-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;   /* ~65 / 35 weighting */
  gap: 1.25rem;
}

.path-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s ease;
}
.path-card:hover { border-color: var(--border-strong); }
.path-card .btn { align-self: flex-start; margin-top: auto; }
.path-card p { color: var(--text-dim); }

.path-media { border-top: 2px solid var(--accent); }

.card-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

@media (max-width: 780px) {
  .paths-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   9. Editorial standard pull quote
   ------------------------------------------------------------ */
.standard-quote {
  margin: 0 0 2rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--accent);
}
.standard-quote p {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text);
}

/* ------------------------------------------------------------
   10. Principles
   ------------------------------------------------------------ */
.principles-list {
  list-style: none;
  counter-reset: principle;
  padding: 0;
  margin: 2rem 0 0;
  border-top: 1px solid var(--border);
}
.principles-list li {
  counter-increment: principle;
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.principles-list li::before {
  content: counter(principle, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   11. Split layouts (text + image)
   ------------------------------------------------------------ */
.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  margin-top: 1.5rem;
}
.split-reverse { grid-template-columns: 0.85fr 1.15fr; }
.split-reverse .split-text { order: -1; }

@media (max-width: 780px) {
  .split, .split-reverse { grid-template-columns: 1fr; }
  .split-reverse .split-text { order: 0; }
}

.split-text h3 { margin-top: 1.75rem; }
.split-text h3:first-child { margin-top: 0; }

/* Coverage tags */
.tag-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.tag-list li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

/* Advisory check list */
.check-list {
  list-style: none;
  padding: 0;
}
.check-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--text-dim);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.6rem;
  height: 2px;
  background: var(--accent);
}

/* ------------------------------------------------------------
   12. Long-Term Test steps (a real sequence, so numbered)
   ------------------------------------------------------------ */
.test-steps {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.test-step {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.test-step h3 { margin: 0.75rem 0 0.5rem; }
.test-step p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

.test-step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) { .test-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .test-steps { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------
   13. Metrics (render only with real values)
   ------------------------------------------------------------ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.metric {
  border-top: 2px solid var(--accent);
  background: var(--bg-card);
  padding: 1.35rem 1.5rem;
}
.metric-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}
.metric-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

/* ------------------------------------------------------------
   14. Engagement models
   ------------------------------------------------------------ */
.engagement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.engagement-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}
.engagement-card:hover { border-color: var(--border-strong); }
.engagement-card p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }
.engagement-card-advisory { border-left: 2px solid var(--accent); }

/* ------------------------------------------------------------
   15. Proof cards (collaborations and case studies)
   ------------------------------------------------------------ */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.proof-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.proof-card img { max-height: 36px; width: auto; align-self: flex-start; }
.proof-card h3 { margin: 0; }
.proof-card p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

.proof-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.proof-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.proof-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
}
.proof-status--published {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.proof-link {
  color: var(--accent);
  font-size: 0.95rem;
  text-decoration: none;
  margin-top: 0.4rem;
}
.proof-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------
   16. Contact
   ------------------------------------------------------------ */
.section-contact {
  border-top: 1px solid var(--border);
}

.contact-paths {
  display: grid;
  grid-template-columns: 1.4fr 1fr;   /* media-led weighting continues */
  gap: 1.25rem;
  margin: 2.5rem 0;
}
@media (max-width: 780px) { .contact-paths { grid-template-columns: 1fr; } }

.contact-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.contact-card p { color: var(--text-dim); margin: 0; }
.contact-card .btn { align-self: flex-start; margin-top: 0.5rem; }

.contact-email { color: var(--text-dim); }
.contact-email a { color: var(--accent); text-decoration: none; }
.contact-email a:hover { text-decoration: underline; }

/* ------------------------------------------------------------
   17. Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  background: var(--bg-raised);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-line { color: var(--text-dim); font-size: 0.95rem; margin-top: 0.5rem; }

.footer-links, .footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links a, .footer-social a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-links a:hover, .footer-social a:hover { color: var(--text); }

.footer-legal {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-legal p { margin: 0; }

/* ------------------------------------------------------------
   18. Scroll reveal (subtle, disabled under reduced motion)
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* No-JS fallback: everything visible */
.no-observer .reveal { opacity: 1; transform: none; }

/* ------------------------------------------------------------
   19. Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   20. Legal pages (privacy, affiliate disclosure, 404)
   ------------------------------------------------------------ */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 2.5rem);
}
.legal-page h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: -0.02em; }
.legal-page h2 { font-size: 1.25rem; margin-top: 2.5rem; }
.legal-page p, .legal-page li { color: var(--text-dim); }
.legal-page a { color: var(--accent); }
.back-link {
  display: inline-block;
  margin-bottom: 2.5rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
}
.back-link:hover { color: var(--text); }
