/*
Theme Name: Fornax
Theme URI: https://www.fornaxsystems.eu/
Author: Fornax Systems Sp. z o.o.
Description: Star-atlas theme for Fornax Systems. Light is the printed plate, dark is the sky it was drawn from.
Version: 1.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
Text Domain: fornax
*/

/* Light is the printed star-atlas plate. Dark is the sky it was drawn from. */
  :root {
    --paper:   #F2F1ED;
    --plate:   #F7F6F3;
    --ink:     #15181B;
    --ink-2:   #3A4148;
    --faint:   #5C6570;
    --hair:    #C9C6BF;
    --grid:    #DEDBD4;
    --star:    #15181B;
    --accent:  #B14B1D;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper:   #101214;
      --plate:   #15181B;
      --ink:     #F2F1ED;
      --ink-2:   #C6C9CC;
      --faint:   #838C95;
      --hair:    #2E353C;
      --grid:    #22282E;
      --star:    #FFFFFF;
      --accent:  #E0733A;
    }
  }
  :root[data-theme="dark"] {
    --paper:   #101214;
    --plate:   #15181B;
    --ink:     #F2F1ED;
    --ink-2:   #C6C9CC;
    --faint:   #838C95;
    --hair:    #2E353C;
    --grid:    #22282E;
    --star:    #FFFFFF;
    --accent:  #E0733A;
  }

  * { box-sizing: border-box; }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 19px; line-height: 1.62;
    -webkit-font-smoothing: antialiased;
  }

  .sheet {
    display: flex; flex-direction: column;
    max-width: 1080px; width: 100%; margin: 0 auto;
    padding-inline: clamp(20px, 5vw, 56px);
    padding-block: clamp(40px, 6vw, 76px);
    gap: clamp(64px, 9vw, 124px);
  }

  .eyebrow, .nav, figcaption, footer, .facet-label, .ph {
    font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  }

  /* ---- masthead: sticky, full-bleed rule, content on the sheet measure ---- */
  .topbar {
    position: sticky; top: 0; z-index: 20;
    background: var(--paper);
    border-bottom: 1px solid var(--hair);
  }
  .topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 14px 26px;
    max-width: 1080px; margin: 0 auto;
    padding-inline: clamp(20px, 5vw, 56px);
    padding-block: 15px;
  }
  .logo { width: clamp(164px, 24vw, 212px); flex: none; }
  .logo svg { display: block; width: 100%; height: auto; }

  .nav {
    display: flex; align-items: baseline; gap: 10px 22px; flex-wrap: wrap;
    font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  }
  .nav a { color: var(--faint); text-decoration: none; }
  .nav a:hover { color: var(--accent); }
  .lang { display: inline-flex; gap: 8px; align-items: baseline; color: var(--hair); }
  .lang b { color: var(--ink); font-weight: 500; }
  .lang a { color: var(--faint); }

  /* ---- hero ---- */
  .hero {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: clamp(32px, 6vw, 80px); align-items: center;
    padding-block: clamp(8px, 4vw, 56px) clamp(0px, 2vw, 24px);
  }
  h1 {
    margin: 0;
    font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
    font-stretch: 112%; font-weight: 600;
    font-size: clamp(2.3rem, 6.6vw, 4.1rem);
    line-height: 1.04; letter-spacing: -.025em; text-wrap: balance;
  }
  h1 em { font-style: normal; color: var(--accent); }

  .under {
    margin: clamp(20px, 2.6vw, 30px) 0 0;
    font-size: clamp(1.12rem, 1.9vw, 1.32rem);
    color: var(--ink-2); max-width: 46ch;
  }

  .plate-wrap { margin: 0; display: flex; flex-direction: column; gap: 12px; width: 100%; }
  .plate-wrap svg { display: block; width: 100%; height: auto; max-width: 100%; }
  figcaption { font-size: .72rem; line-height: 1.65; color: var(--faint); letter-spacing: .02em; }

  /* ---- banded sections: plate margin on the left, text on the right ---- */
  .band {
    display: grid; grid-template-columns: 150px minmax(0, 1fr);
    gap: clamp(18px, 4vw, 48px);
    border-top: 1px solid var(--hair); padding-top: clamp(22px, 3vw, 34px);
  }
  .eyebrow {
    margin: 0; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase;
    color: var(--faint); line-height: 1.9;
  }
  .band h2 {
    margin: 0 0 .6em;
    font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
    font-stretch: 108%; font-weight: 600;
    font-size: clamp(1.55rem, 3.1vw, 2.2rem);
    line-height: 1.14; letter-spacing: -.018em; text-wrap: balance;
  }
  .band p { margin: 0 0 1em; max-width: 62ch; color: var(--ink-2); }
  .band p:last-child { margin-bottom: 0; }
  .band p strong { color: var(--ink); font-weight: 500; }

  /* ---- lifecycle plate ---- */
  .track { overflow-x: auto; margin-block: clamp(26px, 3.4vw, 36px); }
  .track svg { display: block; width: 100%; min-width: 580px; height: auto; }

  /* ---- three facets ---- */
  .facets {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 34px);
  }
  .facet { display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--hair); padding-top: 14px; }
  .facet-label { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
  .facets p { margin: 0; font-size: 1.06rem; color: var(--ink-2); max-width: none; }

  /* ---- contact form ---- */
  .form {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px; margin-top: clamp(26px, 3vw, 34px); max-width: 62ch;
  }
  .field { display: flex; flex-direction: column; gap: 7px; }
  .field.wide { grid-column: 1 / -1; }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .field label {
    font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
    font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
  }
  .field label i { font-style: normal; letter-spacing: .06em; opacity: .7; }
  .field input, .field textarea {
    font-family: "Source Serif 4", Georgia, serif; font-size: 1.05rem;
    color: var(--ink); background: var(--plate);
    border: 1px solid var(--hair); border-radius: 2px;
    padding: 10px 12px; width: 100%;
  }
  .field textarea { min-height: 136px; resize: vertical; line-height: 1.55; }
  .field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
  .form-actions {
    grid-column: 1 / -1; display: flex; flex-wrap: wrap;
    gap: 14px 20px; align-items: center;
  }
  .send {
    font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
    font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--paper); background: var(--accent);
    border: none; border-radius: 2px; padding: 12px 22px; cursor: pointer;
  }
  .send:hover { background: var(--ink); }
  .form-note {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
    font-size: .72rem; color: var(--faint); letter-spacing: .03em;
  }

  /* ---- footer ---- */
  .ph {
    font-size: .72rem; color: var(--faint);
    border: 1px dashed var(--hair); padding: 6px 11px; border-radius: 3px;
  }
  footer {
    display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: baseline;
    border-top: 1px solid var(--hair); padding-top: 18px;
    font-size: .72rem; color: var(--faint);
  }
  footer .right { margin-left: auto; letter-spacing: .1em; text-transform: uppercase; }

  a { color: var(--accent); }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

  @media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; align-items: start; gap: 34px; }
    .plate-wrap { order: -1; max-width: 340px; }
    .band { grid-template-columns: 1fr; gap: 12px; }
    .facets { grid-template-columns: 1fr; }
    .form { grid-template-columns: 1fr; }
  }
  /* ---- the one orchestrated moment: the plate draws itself on load ----
     Base state is the finished drawing. The keyframes run backwards from it,
     so if animation is unavailable or unwanted the plate is simply there. */
  @keyframes starIn { from { opacity: 0; transform: scale(.35); } }
  @keyframes lineDraw { from { stroke-dashoffset: 140; } }

  @media (prefers-reduced-motion: no-preference) {
    .plate-star {
      transform-box: fill-box; transform-origin: center;
      animation: starIn .55s cubic-bezier(.2, .7, .3, 1) backwards;
    }
    .s1 { animation-delay: .20s; }
    .s2 { animation-delay: .36s; }
    .s3 { animation-delay: .52s; }

    .plate-line {
      stroke-dasharray: 140;
      animation: lineDraw .7s cubic-bezier(.4, 0, .2, 1) backwards;
    }
    .l1 { animation-delay: .70s; }
    .l2 { animation-delay: .90s; }
  }

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

/* ======================================================================
   WordPress compatibility layer
   Everything above is the static build, unchanged. These rules only adapt
   it to the wrappers WordPress adds: template parts, post content, groups.
   ====================================================================== */

.wp-site-blocks { padding: 0; }

/* WordPress's flow layout adds block-gap margins; the design spaces with
   grid/flex gap instead. */
.sheet > *, .sheet-main > *, .wp-block-post-content > *,
.hero > *, .band > *, .topbar-inner > * { margin-block: 0; }

/* Sections now sit inside post content rather than directly in .sheet. */
.sheet-main .wp-block-post-content {
  display: flex; flex-direction: column;
  gap: clamp(64px, 9vw, 124px);
}

/* The sticky masthead is the template-part wrapper itself, so it sticks
   against the whole page. Clear the admin bar when logged in. */
.admin-bar .topbar { top: 32px; }
@media (max-width: 782px) { .admin-bar .topbar { top: 46px; } }

a.logo { display: block; }

footer.wp-block-template-part > p { margin-block: 0; }

/* Titles on posts/archives (the one-page site has none). */
.wp-block-post-title {
  margin: 0 0 .6em;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-stretch: 108%; font-weight: 600;
  font-size: clamp(1.55rem, 3.1vw, 2.2rem);
  line-height: 1.14; letter-spacing: -.018em;
}
.wp-block-post-title a { color: inherit; text-decoration: none; }
