@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #15191f;
  --ink-2: #3b434f;
  --muted: #6c7480;
  --line: #e7e1d6;
  --line-soft: #efeae1;
  --paper: #f7f4ee;
  --paper-2: #fdfbf7;
  --white: #ffffff;

  --deep: #0d1320;
  --deep-2: #15203a;
  --deep-line: rgba(255, 255, 255, 0.12);

  --accent: #9a6a28;        /* ochre — eyebrows / links on light */
  --gold: #d3a857;          /* bright gold — on dark surfaces */
  --gold-soft: #f3ead7;

  --shadow: 0 26px 60px -28px rgba(20, 24, 32, 0.35);
  --shadow-card: 0 1px 0 rgba(20, 24, 32, 0.03);
  --radius: 12px;
  --radius-sm: 9px;
  --max: 1180px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

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

::selection {
  background: var(--gold-soft);
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 244, 238, 0.85);
  border-bottom: 1px solid rgba(231, 225, 214, 0.9);
  backdrop-filter: saturate(150%) blur(14px);
}

.nav-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--deep);
  color: var(--white);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.brand strong {
  display: block;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

.primary-nav {
  justify-self: end;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav > div > ul,
.primary-nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
}

.primary-nav li {
  position: relative;
}

.primary-nav a {
  display: block;
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  transition: color 140ms ease, background 140ms ease;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a {
  background: rgba(154, 106, 40, 0.09);
  color: var(--ink);
}

/* Dropdown submenus — markup uses bare nested <ul> (no .sub-menu class) */
.primary-nav > ul ul,
.primary-nav .sub-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  min-width: 250px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  z-index: 20;
}

.primary-nav > ul ul a {
  font-size: 13.5px;
  white-space: nowrap;
}

.primary-nav > ul li:hover > ul,
.primary-nav > ul li:focus-within > ul,
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
  display: block;
}

.primary-nav > ul ul ul,
.primary-nav .sub-menu .sub-menu {
  left: 100%;
  top: 0;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
}

.lang-switcher ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang-switcher a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-2);
  transition: border-color 140ms ease, color 140ms ease;
}

.lang-switcher a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
}

/* ---------- Layout primitives ---------- */
.site-main {
  min-height: 68vh;
}

.section,
.page-hero,
.article {
  padding: 88px 22px;
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-inner.narrow {
  max-width: 820px;
}

/* ---------- Typography ---------- */
.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 540;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

h3 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(42px, 6.4vw, 74px);
  max-width: 16ch;
}

h2 {
  font-size: clamp(30px, 4vw, 47px);
}

.lead {
  margin: 22px 0 0;
  max-width: 64ch;
  color: var(--ink-2);
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.55;
  font-weight: 400;
}

.body-copy {
  color: var(--ink-2);
  font-size: 18px;
}

.body-copy p:first-child {
  margin-top: 0;
}

/* ---------- Buttons ---------- */
.hero-actions,
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button,
.button-secondary,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 650;
  font-size: 15px;
  line-height: 1.2;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover,
.wp-block-button__link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -14px rgba(20, 24, 32, 0.5);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border-color: rgba(21, 25, 31, 0.28);
}

.button-secondary:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* Buttons on dark surfaces */
.hero-section .button,
.band .button {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c1505;
}

.hero-section .button:hover,
.band .button:hover {
  background: #e2ba6c;
  border-color: #e2ba6c;
}

.hero-section .button-secondary,
.band .button-secondary {
  background: transparent;
  color: #f3efe7;
  border-color: rgba(255, 255, 255, 0.32);
}

.hero-section .button-secondary:hover,
.band .button-secondary:hover {
  border-color: rgba(255, 255, 255, 0.7);
}

/* ---------- Home hero (dark editorial) ---------- */
.hero-section {
  position: relative;
  display: block;
  padding: 104px 22px 0;
  overflow: hidden;
  color: #f4efe6;
  background:
    linear-gradient(104deg, rgba(13, 19, 32, 0.97) 0%, rgba(13, 19, 32, 0.9) 46%, rgba(13, 19, 32, 0.45) 74%, rgba(13, 19, 32, 0.65) 100%),
    radial-gradient(120% 120% at 80% 0%, rgba(211, 168, 87, 0.16), transparent 55%),
    url("../img/ai-systems-hero.png") center right / cover no-repeat,
    var(--deep);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.hero-content {
  max-width: 800px;
  padding-bottom: 64px;
}

.hero-section .eyebrow {
  color: var(--gold);
}

.hero-section h1 {
  color: #fbf8f2;
  max-width: 18ch;
}

.hero-section .lead {
  color: #cdd2da;
  max-width: 60ch;
}

/* Hero credential row */
.hero-stats {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--deep-line);
}

.hero-stats .stat {
  padding: 26px 30px 30px 0;
  border-right: 1px solid var(--deep-line);
}

.hero-stats .stat:last-child {
  border-right: 0;
}

.hero-stats .stat strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 40px;
  line-height: 1;
  color: var(--gold);
}

.hero-stats .stat span {
  display: block;
  margin-top: 10px;
  color: #aeb6c1;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Legacy stat-strip (kept for any other page that uses it) */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: var(--max);
  margin: -42px auto 0;
  padding: 0 22px;
  position: relative;
  z-index: 2;
}

.stat-strip .stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 24px;
}

.stat-strip .stat strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  line-height: 1;
}

.stat-strip .stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Inner page hero ---------- */
.page-hero {
  padding: 92px 22px 64px;
  background:
    radial-gradient(110% 130% at 85% -10%, rgba(154, 106, 40, 0.08), transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- Sections ---------- */
.section {
  position: relative;
}

.section.band {
  background:
    radial-gradient(120% 120% at 85% 0%, rgba(211, 168, 87, 0.12), transparent 55%),
    linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%);
  color: #eef0f4;
}

.band .eyebrow {
  color: var(--gold);
}

.band h2,
.band h3 {
  color: #fbf8f2;
}

.band .lead,
.band p {
  color: #c6ccd6;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: 56px;
  align-items: start;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: center;
}

/* ---------- Cards / grids ---------- */
.card-grid,
.project-grid,
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card,
.project-card,
.post-card,
.service-card,
.proof-card {
  display: block;
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-card);
}

a.card,
a.project-card,
a.post-card,
a.service-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

a.card:hover,
a.project-card:hover,
a.post-card:hover,
a.service-card:hover {
  border-color: #d8b878;
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

a.card h3 {
  transition: color 140ms ease;
}

a.card:hover h3 {
  color: var(--accent);
}

.card h3,
.project-card h3,
.service-card h3,
.proof-card h3 {
  margin-bottom: 10px;
}

.card p,
.project-card p,
.post-card p,
.service-card p,
.proof-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}

/* Band cards */
.band .card,
.band .proof-card,
.band .project-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.13);
  color: #eef0f4;
}

.band .card p,
.band .proof-card p,
.band .project-card p {
  color: #c6ccd6;
}

.band a.card:hover,
.band a.project-card:hover {
  border-color: rgba(211, 168, 87, 0.55);
}

/* ---------- Tags / pills ---------- */
.tag-row,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag,
.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(154, 106, 40, 0.09);
  color: #7c5a23;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.band .tag,
.band .pill {
  background: rgba(211, 168, 87, 0.16);
  color: #e7cf9c;
}

.status-pill.live {
  background: rgba(21, 128, 61, 0.1);
  color: #15803d;
}

.status-pill.private,
.status-pill.prototype,
.status-pill.research {
  background: rgba(154, 106, 40, 0.12);
  color: #8a6324;
}

/* ---------- Timeline (career) ---------- */
.timeline {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:first-child {
  border-top: 1px solid var(--line);
}

.timeline-year {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  padding-top: 2px;
}

.timeline-item h3 {
  margin-bottom: 4px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.timeline-item .tag-row {
  margin-top: 12px;
}

/* ---------- Project detail ---------- */
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0;
}

.project-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(280px, 0.28fr);
  gap: 40px;
  align-items: start;
}

.project-sidebar {
  position: sticky;
  top: 100px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

/* ---------- Contact ---------- */
.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 40px;
}

.ck-contact-form {
  display: grid;
  gap: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.ck-contact-form label {
  display: grid;
  gap: 6px;
  font-weight: 650;
  font-size: 14px;
}

.ck-contact-form input,
.ck-contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font: inherit;
  font-size: 15px;
  background: var(--white);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.ck-contact-form input:focus,
.ck-contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(154, 106, 40, 0.12);
}

.ck-contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.notice {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #e9f7ef;
  color: #14532d;
  font-weight: 650;
}

.notice.error {
  background: #fff1f2;
  color: #991b1b;
}

/* ---------- Insights / posts ---------- */
.post-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.post-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-body,
.article-body p {
  margin-top: 24px;
  font-size: 18.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.article-body h2 {
  margin-top: 48px;
}

.article-body h3 {
  margin-top: 36px;
  font-size: 22px;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 72px 22px 30px;
  background: var(--deep);
  color: #cfd6e1;
}

.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr;
  gap: 44px;
}

.footer-grid p,
.site-footer a {
  color: #b9c1ce;
}

.site-footer a:hover {
  color: var(--gold);
}

.footer-brand strong {
  color: #f4efe6;
}

.footer-brand small {
  color: var(--gold);
}

.site-footer h2 {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 14px;
  text-transform: uppercase;
  color: #8e97a5;
}

.footer-brand .brand-mark {
  background: var(--gold);
  color: #1c1505;
}

.footer-brand {
  margin-bottom: 16px;
}

.footer-bottom {
  max-width: var(--max);
  margin: 44px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: #8e97a5;
}

.footer-bottom ul {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav-shell {
    grid-template-columns: auto 1fr auto;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: end;
    order: 3;
  }

  .lang-switcher {
    order: 2;
    justify-self: end;
  }

  .primary-nav {
    display: none;
    order: 4;
    grid-column: 1 / -1;
    justify-self: stretch;
    margin-top: 8px;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav > div > ul,
  .primary-nav > ul {
    display: grid;
    gap: 2px;
  }

  .primary-nav > ul ul,
  .primary-nav .sub-menu {
    position: static;
    display: block;
    min-width: 0;
    border: 0;
    box-shadow: none;
    background: rgba(154, 106, 40, 0.06);
    border-radius: 8px;
    padding: 4px;
    margin: 2px 0 6px 12px;
  }

  .hero-section {
    padding-top: 76px;
    background:
      linear-gradient(180deg, rgba(13, 19, 32, 0.95) 0%, rgba(13, 19, 32, 0.88) 60%, rgba(13, 19, 32, 0.95) 100%),
      url("../img/ai-systems-hero.png") center / cover no-repeat,
      var(--deep);
  }

  .hero-content {
    padding-bottom: 44px;
  }

  .intro-grid,
  .split,
  .project-detail,
  .contact-panel {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .card-grid,
  .project-grid,
  .service-grid,
  .post-list,
  .stat-strip,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats .stat {
    padding: 22px 20px 22px 0;
  }

  .hero-stats .stat:nth-child(2) {
    border-right: 0;
  }

  .hero-stats .stat:nth-child(1),
  .hero-stats .stat:nth-child(2) {
    border-bottom: 1px solid var(--deep-line);
  }

  .stat-strip {
    margin-top: 0;
  }

  .project-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .nav-shell {
    padding: 11px 16px;
    gap: 10px;
  }

  .brand small {
    display: none;
  }

  .section,
  .page-hero,
  .article {
    padding: 56px 18px;
  }

  .hero-section {
    padding: 64px 18px 0;
  }

  .hero-content {
    padding-bottom: 36px;
  }

  .card-grid,
  .project-grid,
  .service-grid,
  .post-list,
  .stat-strip,
  .footer-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats .stat,
  .hero-stats .stat:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--deep-line);
    padding: 18px 0;
  }

  .hero-stats .stat:last-child {
    border-bottom: 0;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
