:root {
  --color-bg: #faf9f6;
  --color-fg: #14110f;
  --color-muted: #5c574f;
  --color-rule: #ddd7c9;
  --color-accent: #8a6d3b; /* TODO: swap for Kudos brand color */
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 38rem;      /* readable line length for body text */
  --content-max: 88rem;  /* outer composition width, kept wide on desktop by design */
  --inset: clamp(1.25rem, 5vw, 4rem);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:hover { color: var(--color-accent); }

img, iframe { max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Shared composition grid — header, main, and footer all align to the
   same inset, so content reads as one anchored column, not a centered
   card floating in symmetric whitespace. */
.site-header, main, .site-footer {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--inset);
}

/* Header / nav */
.site-header {
  border-bottom: 1px solid var(--color-rule);
  padding-block: 1.1rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 0;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: currentColor;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  padding: 1rem;
  z-index: 10;
}
.nav-menu.open { display: flex; }
.nav-menu a {
  display: block;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 0.6rem 0;
  min-height: 44px;
}

@media (min-width: 48em) {
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex;
    flex-direction: row;
    position: static;
    border: 0;
    padding: 0;
    margin-top: 0;
    background: transparent;
    gap: 2.25rem;
  }
  .nav-menu a { padding: 0; min-height: auto; }
}

/* Main content */
main { padding-block: var(--inset) clamp(3rem, 6vw, 5rem); }

.page {
  max-width: var(--measure);
  position: relative;
}

/* A quiet structural mark in the right void on wide screens — Miesian
   restraint reads as composed rather than merely empty when there's at
   least one deliberate line giving the whitespace a shape. */
@media (min-width: 60em) {
  body:not(.is-home) .page::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(100% + clamp(2rem, 6vw, 5rem));
    width: 1px;
    background: var(--color-rule);
  }
}

.page p,
.hero-text p,
.app-embed p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.hero {
  display: grid;
  gap: clamp(2rem, 6vw, 4.5rem);
  padding-block: clamp(1.5rem, 6vw, 4rem) clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

@media (min-width: 60em) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

/* The wordmark heads the right-hand column, directly above the portrait, so
   the brand and the face read as one block and the name and tagline hold the
   left. On mobile the column stacks first — the mark leads the page. */
.hero-logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 0 1.5rem;
}

@media (max-width: 59.99em) {
  .hero-portrait { order: -1; }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 0 0 0.6rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw + 1rem, 3.6rem);
  line-height: 1.08;
  margin: 0 0 1rem;
}

h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 2px;
  background: var(--color-accent);
  margin-top: 1.1rem;
}

/* The home hero carries the wordmark, so the name steps down a size and
   gives it room — on inner pages the h1 stays the dominant note. */
.is-home .hero h1 { font-size: clamp(1.9rem, 2.2vw + 1rem, 2.75rem); }

.tagline {
  font-size: clamp(1.05rem, 1vw + 1rem, 1.35rem);
  color: var(--color-muted);
  max-width: 34ch;
}

.motto {
  margin: 2.25rem 0 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--color-accent);
}
.motto p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 1vw + 1rem, 1.4rem);
  margin: 0;
}
.motto cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.cta {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.85rem 1.5rem;
  min-height: 44px;
  background: var(--color-fg);
  color: var(--color-bg);
  text-decoration: none;
  font-size: 0.95rem;
}
.cta:hover { background: var(--color-accent); color: var(--color-bg); }

/* Portrait — layered planes, sharp corners: two offset rectangles rather
   than a single boxed photo, echoing Mies's floating-plane compositions. */
/* width, not justify-self:start — a start-aligned grid item sizes to its
   content, which lets the wordmark and the portrait settle on different
   edges instead of sharing one. */
.hero-portrait { width: 100%; max-width: 300px; }
.portrait-frame {
  position: relative;
  width: 100%;
  max-width: 300px;
}
.portrait-frame::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid var(--color-accent);
  z-index: 0;
}
.portrait-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-fg);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw + 1rem, 1.8rem);
  margin-top: 2.5rem;
}

/* Home principles — list-style is removed because the 01/02/03 numerals are
   typeset by the template; leaving it on gives every item two numbers. */
.principles {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}

.principle { border-top: 1px solid var(--color-rule); padding-top: 1rem; }

.principle-num {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
}

.principle-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
}

.principle-body {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
  text-align: left;
}

@media (min-width: 48em) {
  .principles { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  /* The principles are a grid, not prose, so the home page relaxes the
     reading measure to give the three columns room. */
  .is-home .page { max-width: 62rem; }
}

/* Brand wall (Track Record) — logos are held to one optical weight rather
   than one literal size: a shared max-height sets the cap-height, and the
   max-width tier keeps a very wide wordmark from dominating the row. Muted
   to a single grey by default so the wall reads as one composed block; each
   mark returns to its own colour on hover. */
.brand-wall { margin: 2.5rem 0 3rem; }

.brand-sector { border-top: 1px solid var(--color-rule); padding-top: 1rem; }
.brand-sector + .brand-sector { margin-top: 2.25rem; }

.brand-sector-name {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-muted);
  margin: 0 0 1.25rem;
}

.brand-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem 2.25rem;
}

.brand-cell { display: flex; align-items: center; min-height: 2.2rem; }

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 2.2rem;
  max-width: 7.5rem;
  filter: grayscale(1);
  opacity: 0.72;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.brand-logo.is-wide { max-width: 10rem; }
.brand-logo.is-compact { max-height: 2.6rem; max-width: 2.6rem; }

.brand-logo:hover { filter: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .brand-logo { transition: none; }
}

/* App embeds */
.app-embed { margin: 2rem 0; }
.iframe-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #eee;
}
.iframe-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-rule);
  padding-block: var(--inset);
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: left;
}
.motto-footer { max-width: 40ch; margin: 0 0 0.75rem; font-style: italic; }
.contact-line a { text-decoration: underline; }
