/* P1 Engineering — letterpress design system
   Cream paper, Caslon serifs, double rules, rust accent. */

:root {
  color-scheme: light;
  --paper: #f7f1e5;
  --paper-bright: #fbf6ec;
  --ink: #2a2722;
  --ink-soft: #5c554a;
  --rust: #b04a26;
  --brass: #d9a03f;
  --line: #d6ccb8;
  --serif: 'Libre Caslon Text', serif;
  --sans: 'Libre Franklin', sans-serif;
}

/* Night mode: everything inverts (the dark Pricing section goes light),
   rust accent becomes brass, brass becomes rust on the now-light pricing. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #2a2722;
    --paper-bright: #343029;
    --ink: #f7f1e5;
    --ink-soft: #cfc8ba;
    --rust: #d9a03f;
    --brass: #b04a26;
    --line: #45403a;
  }
  .story-dialog { border-color: #45403a; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% -10%, var(--paper-bright) 0%, var(--paper) 60%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust);
}

.rule {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 64px;
}
.rule i { display: block; height: 1px; background: var(--ink); opacity: 0.85; }
.rule i:last-child { opacity: 0.3; }

/* ---------- nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 20px 64px 16px 64px;
  font-size: 15px;
}
.nav a { color: var(--ink-soft); text-decoration: none; letter-spacing: 0.04em; position: relative; top: 5.5px; }
.nav a.navmark { top: 0; }
.nav a:hover { color: var(--rust); }
.nav a.active { color: var(--rust); }
.nav .navmark {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 18px;
  color: var(--ink);
  text-decoration: none;
}
.nav .navmark img { display: block; flex: none; height: 76px; width: auto; }
/* Hover tint: the lockup PNG's alpha becomes a mask filled with the accent
   color — all rust in day mode, all brass at night. */
.nav .navmark { position: relative; }
.nav .navmark .marktint {
  position: absolute;
  inset: 0;
  background: var(--rust);
  -webkit-mask: url("../img/p1-lockup.png") center / contain no-repeat;
  mask: url("../img/p1-lockup.png") center / contain no-repeat;
  opacity: 0;
  pointer-events: none;
}
.nav .navmark:hover .marktint { opacity: 1; }
.nav .navmark:hover img { opacity: 0; }

/* ---------- hero ---------- */

.hero {
  text-align: center;
  padding: 76px 64px 60px 64px;
  max-width: 1080px;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 26px 0 8px 0;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--rust); }
.hero h1 .accent { color: var(--rust); }
.hero .lede {
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 22px auto 36px auto;
  text-wrap: pretty;
}

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 16px 34px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--rust); }
.subnote {
  display: block;
  margin-top: 16px;
  font-style: italic;
  font-family: var(--serif);
  color: var(--ink-soft);
  font-size: 16px;
}

/* ---------- photo row ---------- */

.photos {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  padding: 0 64px 64px 64px;
  max-width: 1280px;
  margin: 0 auto;
}
.photos figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.photos img.photo { width: 100%; height: 250px; display: block; object-fit: cover; border-radius: 4px; }
.photos figcaption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 10px;
}
.storylink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 2px 0;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rust);
}
.storylink span { transition: transform 0.15s ease; }
.storylink:hover span { transform: translateX(3px); }
.storycontent { display: none; }

/* ---------- story modal ---------- */

.story-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.story-modal[hidden] { display: none; }
.story-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 20, 14, 0.55);
  backdrop-filter: blur(2px);
}
.story-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow: auto;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding-bottom: 40px;
  animation: story-rise 0.22s ease both;
}
@keyframes story-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .story-dialog { animation: none; }
}
.story-media:empty { display: none; }
.story-photo { width: 100%; height: 320px; display: block; object-fit: cover; }
.story-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.story-photos img { width: 100%; height: 320px; display: block; object-fit: cover; }
.story-body { padding: 26px 44px 0 44px; }
.story-body .eyebrow { display: block; }
.story-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin: 12px 0 16px 0;
}
.story-body p { color: var(--ink-soft); margin: 0 0 14px 0; }
.story-body .story-todo {
  font-style: italic;
  color: var(--ink-soft);
  border-left: 2px solid var(--line);
  padding-left: 14px;
}
.story-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: rgba(24, 20, 14, 0.55);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-close:hover { background: rgba(24, 20, 14, 0.78); }

/* ---------- sections ---------- */

.section { padding: 64px 64px; max-width: 1180px; margin: 0 auto; }
.sectionhead { text-align: center; margin-bottom: 44px; }
.sectionhead h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  margin: 14px 0 0 0;
}
.sectionhead .headnote {
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 14px auto 0 auto;
  text-wrap: pretty;
}

/* ---------- capabilities ---------- */

.caps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cap {
  padding: 36px 26px 40px 26px;
  border-right: 1px solid var(--line);
  text-align: center;
  position: relative;
}
.cap:last-child { border-right: none; }
.cap .capnum {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--rust);
}
.cap h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 23px;
  margin: 10px 0 12px 0;
}
.cap p { color: var(--ink-soft); font-size: 16px; margin: 0 0 18px 0; }
.cap p.capblurb { max-width: 220px; margin-left: auto; margin-right: auto; }
.cap ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cap li { font-size: 15.5px; }
.cap .capbadge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--rust);
  color: var(--paper);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.alsoline {
  text-align: center;
  margin: 30px auto 0 auto;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 70ch;
  text-wrap: pretty;
}
.alsoline b {
  color: var(--ink);
  font-weight: 700;
  font-style: normal;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-right: 8px;
}

/* ---------- first hardware / centered feature ---------- */

.feature {
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}
.feature h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  margin: 14px 0 18px 0;
  text-wrap: balance;
}
.feature p {
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 auto 16px auto;
  text-wrap: pretty;
}
.feature p:last-child { margin-bottom: 0; }
.feature .serifline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
}

/* ---------- fit columns ---------- */

.fit {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}
.fit h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  margin: 12px 0 14px 0;
}
.fit p { color: var(--ink-soft); margin: 0 0 14px 0; text-wrap: pretty; }
.fit p:last-child { margin-bottom: 0; }
.fitnote {
  max-width: 76ch;
  margin: 52px auto 0 auto;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.fitnote p { color: var(--ink-soft); margin: 10px 0 0 0; text-wrap: pretty; }
.dropcap::first-letter {
  font-family: var(--serif);
  font-size: 52px;
  line-height: 0.85;
  float: left;
  padding: 6px 10px 0 0;
  color: var(--rust);
}

/* ---------- pricing ---------- */

.price {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 72px 64px 76px 64px;
}
.price .eyebrow { color: var(--brass); }
.price h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  margin: 16px 0 18px 0;
}
.price .pricelede {
  color: #cfc8ba;
  max-width: 62ch;
  margin: 0 auto 44px auto;
  font-size: 18px;
  text-wrap: pretty;
}
.pricecols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  max-width: 1000px;
  margin: 0 auto;
}
.pricecol { padding: 0 36px; border-right: 1px solid #4a463e; }
.pricecol:last-child { border-right: none; }
.pricecol .amt {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--brass);
  display: block;
  margin-bottom: 8px;
}
.pricecol .what { color: #cfc8ba; font-size: 16px; }
.pricefoot {
  margin-top: 44px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: #cfc8ba;
}
.pricefoot a { color: var(--paper); }

/* ---------- AI block ---------- */

.ai { text-align: center; max-width: 860px; margin: 0 auto; }
.ai blockquote {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.45;
  margin: 22px 0 24px 0;
  text-wrap: balance;
}
.ai blockquote em { color: var(--rust); }
.ai .ailede { color: var(--ink-soft); max-width: 60ch; margin: 0 auto 26px auto; text-wrap: pretty; }
a.more {
  color: var(--rust);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--rust);
  padding-bottom: 2px;
}

/* ---------- about ---------- */

.about {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 56px;
  align-items: center;
}
.about img.portrait {
  width: 360px;
  height: 420px;
  display: block;
  object-fit: cover;
  border-radius: 50% 50% 4px 4px / 38% 38% 4px 4px;
}
.about h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 36px;
  margin: 12px 0 16px 0;
}
.about p { color: var(--ink-soft); margin: 0 0 14px 0; max-width: 58ch; text-wrap: pretty; }
.about p:last-child { margin-bottom: 0; }

/* ---------- contact / footer ---------- */

.contact { text-align: center; padding: 64px 64px 8px 64px; }
.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  margin: 18px 0 14px 0;
}
.contact p { color: var(--ink-soft); max-width: 52ch; margin: 0 auto 30px auto; font-size: 19px; text-wrap: pretty; }
.contact .email {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--rust);
  text-decoration: none;
  border-bottom: 1px solid var(--rust);
  padding-bottom: 2px;
}
.foot {
  text-align: center;
  margin-top: 56px;
  padding-bottom: 48px;
  font-size: 13.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.foot .orn {
  color: var(--rust);
  font-size: 16px;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
  font-family: var(--serif);
}
.foot .orn::before,
.foot .orn::after {
  content: '';
  height: 1px;
  width: 56px;
  background: var(--line);
}

/* ---------- article (On AI page) ---------- */

.article { max-width: 760px; margin: 0 auto; padding: 24px 64px 0 64px; }
.article h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  margin: 44px 0 12px 0;
}
.article p { color: var(--ink-soft); margin: 0 0 16px 0; text-wrap: pretty; }
.article ul { margin: 0 0 16px 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.article li { color: var(--ink-soft); padding-left: 26px; position: relative; }
.article li::before {
  content: '\2B58';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--rust);
  font-family: var(--serif);
  font-size: 14px;
}
.article li b { color: var(--ink); font-weight: 600; }
.pullrule {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.5;
  text-align: center;
  margin: 52px 0;
  padding: 32px 24px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-wrap: balance;
}
.pullrule em { color: var(--rust); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) and (min-width: 641px) {
  .caps { grid-template-columns: 1fr 1fr; }
  .cap { border-bottom: 1px solid var(--line); }
  .cap:nth-child(even) { border-right: none; }
  .cap:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 640px) {
  .caps { grid-template-columns: 1fr; }
  .cap { border-right: none; border-bottom: 1px solid var(--line); }
  .cap:last-child { border-bottom: none; }
}

@media (max-width: 980px) {
  .nav { flex-wrap: wrap; gap: 18px 24px; padding: 22px 28px 18px 28px; }
  .nav .navmark { width: 100%; justify-content: center; order: -1; padding: 0; }
  .rule { margin: 0 28px; }
  .hero { padding: 52px 28px 44px 28px; }
  .hero h1 { font-size: 38px; }
  .photos { grid-template-columns: 1fr; padding: 0 28px 48px 28px; }
  .story-photos { grid-template-columns: 1fr; }
  .section { padding: 48px 28px; }

  .cap .capbadge { position: static; transform: none; display: inline-block; margin-bottom: 14px; }
  .fit { grid-template-columns: 1fr; gap: 40px; }
  .price { padding: 52px 28px 56px 28px; }
  .pricecols { grid-template-columns: 1fr; gap: 32px; }
  .pricecol { border-right: none; padding: 0; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about img.portrait { width: 100%; max-width: 360px; height: auto; aspect-ratio: 6 / 7; margin: 0 auto; }
  .contact { padding: 48px 28px 8px 28px; }
  .article { padding: 16px 28px 0 28px; }
}

/* Night mode, part 2: the pricing panel goes light, so its fixed grays flip
   to the light-panel palette. Kept at end of file to win the cascade. */
@media (prefers-color-scheme: dark) {
  .price .pricelede,
  .pricecol .what,
  .pricefoot { color: #5c554a; }
  .pricecol { border-right-color: #d6ccb8; }
}

/* base link colors */
a { color: var(--rust); }
a:hover { color: var(--ink); }
