/* Partis Computing - site stylesheet (used when MODERN_LAYOUT is TRUE in constants.php) */

:root {
  --ink: #14212e;
  --text: #2b3a48;
  --muted: #5d6b79;
  --accent: #0f5fa8;
  --accent-dark: #0b4880;
  --accent-soft: #e8f1fa;
  --bg: #ffffff;
  --surface: #f5f7fa;
  --surface-2: #edf1f5;
  --border: #dde3ea;
  --header-bg: #14212e;
  --header-text: #ffffff;
  --radius: 8px;
  --wrap: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body.modern {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
}

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

/* ---------- header ---------- */

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  min-height: 56px;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* original reflective "Partis Computing" title above the menu bar */
.masthead { background: var(--header-bg); text-align: center; line-height: 0; padding-top: 10px; }
.masthead a { display: inline-block; }
.masthead img { display: block; max-width: 100%; height: auto; }

.brand { text-decoration: none; color: inherit; display: flex; flex-direction: column; line-height: 1.2; padding: 14px 0; }
.brand-name { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.01em; color: inherit; }
.brand-tag { font-size: 0.8rem; color: #a9b8c7; margin-top: 2px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: #d5dee7;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.site-nav a.current { background: rgba(255, 255, 255, 0.14); color: #ffffff; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label { display: none; }

/* ---------- home page introduction ---------- */

.hero {
  background:
    radial-gradient(ellipse 60% 80% at 85% 10%, rgba(64, 140, 220, 0.28), transparent 70%),
    linear-gradient(180deg, #14212e 0%, #1a2d40 100%);
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-inner { padding-top: 72px; padding-bottom: 64px; }
.hero-eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fb8e0;
}
.hero-title {
  margin: 0;
  max-width: 16em;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.hero-text {
  margin: 20px 0 0;
  max-width: 36em;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #c9d6e3;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero .btn { padding: 12px 22px; font-size: 1rem; }
.hero .btn-primary { background: #ffffff; color: var(--ink) !important; }
.hero .btn-primary:hover { background: #e3ecf5; }
.hero .btn-ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.35); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

.hero-stats { border-top: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.15); }
.stats-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-top: 24px; padding-bottom: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-figure { font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: #ffffff; }
.stat-label { font-size: 0.85rem; color: #a9b8c7; }

.site-main.after-hero { padding-top: 48px; }

/* ---------- retro touches: circuit traces, terminal prompt and cursor ---------- */

:root {
  --traces: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1.5'%3E%3Cpath d='M0 40h40l20 20h50l20-20h30M20 160v-40l20-20h30M110 160v-30l20-20h30M90 0v30l-20 20H40M140 60v30'/%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3Ccircle cx='110' cy='60' r='3'/%3E%3Ccircle cx='70' cy='100' r='3'/%3E%3Ccircle cx='130' cy='110' r='3'/%3E%3Ccircle cx='40' cy='50' r='3'/%3E%3Ccircle cx='140' cy='90' r='3'/%3E%3C/svg%3E");
}

.site-header, .masthead { background-image: var(--traces); background-size: 160px 160px; }
/* continue the pattern seamlessly from the title band into the menu bar */
.masthead { background-position: center top; }
.site-header { background-position: center -100px; }

.hero {
  background:
    var(--traces),
    radial-gradient(ellipse 60% 80% at 85% 10%, rgba(64, 140, 220, 0.28), transparent 70%),
    linear-gradient(180deg, #14212e 0%, #1a2d40 100%);
  background-size: 160px 160px, auto, auto;
}

.hero-eyebrow::before { content: "> "; color: #5fd38d; }

.hero-title::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.85em;
  margin-left: 0.12em;
  vertical-align: -0.04em;
  background: #5fd38d;
  animation: cursor-blink 1.1s steps(1) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

.stat-figure { font-family: var(--mono); letter-spacing: -0.02em; }
.chip { font-family: var(--mono); font-size: 0.72rem; }
.side-area { font-family: var(--mono); }

body.modern ::selection { background: #5fd38d; color: #14212e; }

@media (prefers-reduced-motion: reduce) {
  .hero-title::after { animation: none; }
}

/* ---------- main ---------- */

.site-main { padding-top: 40px; padding-bottom: 56px; }

.page-title {
  margin: 0 0 28px;
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
}

/* override legacy <font> tags: keep the size hierarchy, drop the fixed face and colour */
body.modern font { font-family: inherit; color: inherit; }
body.modern font[face="Courier"] { font-family: var(--mono); font-size: 0.9em; }
body.modern font[size="1"] { font-size: 0.85rem; color: var(--muted); }
body.modern font[size="2"] { font-size: 1rem; }
body.modern font[size="3"] { font-size: 1.15rem; color: var(--ink); }
body.modern font[size="4"] { font-size: 1.3rem; color: var(--ink); }
body.modern font[size="5"] { font-size: 1.5rem; color: var(--ink); font-weight: 600; }
body.modern font[size="6"] { font-size: 1.75rem; color: var(--ink); font-weight: 600; }
body.modern font[color="#ff0000"] { color: #b42318; }

body.modern b { font-weight: 600; }

body.modern a { color: var(--accent); text-decoration: none; }
body.modern a:hover { text-decoration: underline; }
body.modern a font { color: inherit; }

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

body.modern ul { padding-left: 1.3em; }
body.modern li { margin: 0.25em 0; }

body.modern hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ---------- layout table (content plus optional side panel) ---------- */

table.layout { width: 100%; border-collapse: collapse; }
table.layout td { vertical-align: top; }
td.lead:empty { display: none; }
td.gap { width: 32px; }

td.side { width: 230px; }
td.side.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
td.side.panel > a { color: var(--ink); }
td.side.panel > a:hover font[size="2"] { color: var(--accent); }

/* legacy side cells emitted directly by some pages */
body.modern td[width="140"] { width: 230px; }
body.modern td[bgcolor="#D8D8D8"] { background: var(--surface); }
body.modern td[bgcolor="#D8D8D8"][width="10"] { width: 12px; }

/* section menus (MDOS, Support, Repository) */
.side-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.side-nav br { display: none; }
.side-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text) !important;
  font-size: 0.95rem;
  text-decoration: none !important;
}
.side-link:hover { background: var(--surface); }
.side-link.active { background: var(--accent-soft); color: var(--accent-dark) !important; font-weight: 600; }
.side-area {
  margin: 18px 12px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-area:first-child { margin-top: 0; }
.side-subarea { margin: 10px 12px 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
}
.btn:hover { background: var(--accent-dark); }
body.modern input[type="submit"], body.modern button {
  font: inherit;
  font-weight: 600;
  padding: 9px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}
body.modern input[type="submit"]:hover { background: var(--accent-dark); }
body.modern input[type="text"], body.modern input[type="password"], body.modern input[type="email"], body.modern textarea, body.modern select {
  font: inherit;
  font-size: 0.95rem;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  max-width: 100%;
}

/* alternating legacy cells (news, downloads, shop, tables of values) */
body.modern td[bgcolor="#e8e8e8"],
body.modern td[bgcolor="#d2d2d2"] {
  background: var(--surface);
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
body.modern td[bgcolor="#d2d2d2"] { background: var(--surface-2); }
body.modern td[bgcolor="#e8e8e8"] td[bgcolor="#e8e8e8"],
body.modern td[bgcolor="#e8e8e8"] td[bgcolor="#d2d2d2"],
body.modern td[bgcolor="#d2d2d2"] td[bgcolor="#e8e8e8"],
body.modern td[bgcolor="#d2d2d2"] td[bgcolor="#d2d2d2"] { padding: 0 0 4px; border-top: 0; }

body.modern table { max-width: 100%; }

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

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--muted);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 24px;
}
.footer-about .brand-name { color: var(--ink); font-size: 1.1rem; }
.footer-about p { margin: 8px 0; max-width: 34em; }
.site-footer h2 {
  margin: 0 0 10px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--muted) !important; }
.site-footer a:hover { color: var(--accent) !important; }
.footer-legal {
  padding-top: 16px;
  padding-bottom: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

/* ---------- service cards ---------- */

.services { margin: 8px 0 32px; }
.section-title { margin: 0 0 16px; font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text) !important;
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
a.card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(20, 33, 46, 0.08);
  transform: translateY(-2px);
}
.card-icon {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-title { margin: 4px 0 0; font-size: 1.05rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
a.card:hover .card-title { color: var(--accent); }
.card-text { margin: 0; font-size: 0.93rem; line-height: 1.55; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  a.card:hover { transform: none; }
}

/* ---------- project history timeline ---------- */

.tl-intro { margin: 0 0 24px; max-width: 42em; font-size: 1.05rem; color: var(--muted); }

.tl-jump {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -8px 32px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.tl-jump a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink) !important;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none !important;
}
.tl-jump a:hover { border-color: var(--accent); color: var(--accent) !important; }
.tl-jump span { margin-left: 4px; font-weight: 400; color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }

.timeline { position: relative; }

.tl-decade { scroll-margin-top: 72px; margin-bottom: 40px; }
.tl-decade-title {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.tl-year {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0 28px;
  padding-bottom: 24px;
}
/* vertical line and year marker */
.tl-year::before {
  content: "";
  position: absolute;
  left: 84px;
  top: 6px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-year::after {
  content: "";
  position: absolute;
  left: 79px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.tl-year-label {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  text-align: right;
  line-height: 1.5;
}
.tl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  padding-left: 8px;
}

.tl-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text) !important;
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tl-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(20, 33, 46, 0.08);
  transform: translateY(-1px);
}
.tl-thumb {
  flex: none;
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--surface);
}
.tl-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl-title { font-weight: 600; color: var(--ink); line-height: 1.3; }
.tl-card:hover .tl-title { color: var(--accent); }
.tl-publisher { font-size: 0.85rem; color: var(--muted); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.chip {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* project detail page */
.back-link { margin: -12px 0 20px; font-size: 0.95rem; }
.back-link a::before { content: "\2190\00a0"; }
.project-image img { max-height: 240px; width: auto; border-radius: var(--radius); }

@media (prefers-reduced-motion: reduce) {
  .tl-card { transition: none; }
  .tl-card:hover { transform: none; }
}

/* pop-up windows (portfolio entries) */
body.basic .site-main { padding-top: 24px; padding-bottom: 24px; }
body.basic .page-title { font-size: 1.5rem; }
.close-window { text-align: center; padding-bottom: 24px; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .nav-toggle-label {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
  }
  .site-nav { display: none; width: 100%; padding-bottom: 12px; }
  .nav-toggle:checked ~ .site-nav { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 10px 12px; font-size: 1rem; }
}

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

@media (max-width: 720px) {
  body.modern { font-size: 16px; }
  .hero-inner { padding-top: 48px; padding-bottom: 44px; }
  .hero-text { font-size: 1.05rem; }
  .site-main.after-hero { padding-top: 32px; }
  .wrap { padding: 0 16px; }
  .site-main { padding-top: 28px; }
  .page-title { font-size: 1.6rem; margin-bottom: 20px; }

  table.layout, table.layout > tbody, table.layout > tbody > tr, table.layout > tbody > tr > td { display: block; width: auto !important; }
  td.gap, body.modern td[bgcolor="#D8D8D8"][width="10"] { display: none !important; }
  td.side { margin-bottom: 24px; }
  .side-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-area { width: 100%; margin: 10px 4px 2px; }

  .footer-inner { grid-template-columns: 1fr; gap: 20px; }

  .tl-year { grid-template-columns: 1fr; gap: 10px; padding-left: 24px; }
  .tl-year::before { left: 5px; }
  .tl-year::after { left: 0; }
  .tl-year-label { text-align: left; }
  .tl-cards { padding-left: 0; grid-template-columns: 1fr; }
}
