:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --surface: #fbf9f3;
  --ink: #292823;
  --muted: #6c6961;
  --hairline: #d8d2c5;
  --teal: #3f7175;
  --ochre: #a96f43;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  color: var(--ink);
  background:
    linear-gradient(rgba(63, 113, 117, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 113, 117, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(20px, 5vw, 72px) 28px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(251, 249, 243, 0.82);
}

.eyebrow, .subtitle, h1, h2, p { margin: 0; }
.eyebrow { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.16em; }
h1 { margin-top: 4px; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 560; line-height: 1; }
.subtitle { margin-top: 9px; color: var(--muted); font-size: clamp(0.88rem, 1.4vw, 1.05rem); }

.language-control { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8rem; }
select { min-height: 40px; padding: 0 36px 0 12px; border: 1px solid var(--hairline); border-radius: 7px; color: var(--ink); background: var(--surface); font: inherit; }

main { padding: 30px clamp(20px, 5vw, 72px) 46px; }
.intro { display: grid; grid-template-columns: minmax(180px, 0.45fr) minmax(280px, 1fr); gap: 24px; align-items: baseline; margin-bottom: 24px; }
.intro h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; }
.intro p { max-width: 720px; color: var(--muted); line-height: 1.6; }

.simulation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.simulation-card { min-width: 0; overflow: hidden; border: 1px solid var(--hairline); border-radius: 9px; background: rgba(251, 249, 243, 0.9); }
.image-placeholder { position: relative; display: grid; place-items: center; aspect-ratio: 2 / 1; overflow: hidden; border-bottom: 1px solid var(--hairline); color: rgba(41, 40, 35, 0.48); background: #f7f4ed; }
.image-placeholder::before, .image-placeholder::after { content: ""; position: absolute; inset: auto 8% 35%; height: 1px; background: currentColor; opacity: 0.45; transform: rotate(-7deg); }
.image-placeholder::after { inset: 26% 18% auto; transform: rotate(12deg); }
.image-placeholder span { font-family: ui-serif, Georgia, serif; font-size: clamp(2rem, 5vw, 4rem); font-weight: 300; }
.light-placeholder { color: var(--ochre); }
.flow-placeholder, .wave-placeholder { color: var(--teal); }
.gravity-placeholder { color: #6d6961; }
.electricity-placeholder { color: #607f80; }

.card-body { display: flex; min-height: 208px; flex-direction: column; padding: 18px; }
.category { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.card-body h2 { margin-top: 4px; font-size: 1.5rem; font-weight: 560; }
.description { margin-top: 10px; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; }
.languages { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em; white-space: nowrap; }
.card-footer a { min-width: 82px; padding: 8px 14px; border: 1px solid var(--teal); border-radius: 6px; color: var(--teal); text-align: center; text-decoration: none; font-size: 0.78rem; font-weight: 600; }
.card-footer a:hover, .card-footer a:focus-visible { color: var(--surface); background: var(--teal); outline: none; }

footer { padding: 16px clamp(20px, 5vw, 72px) 24px; border-top: 1px solid var(--hairline); color: var(--muted); text-align: right; font-size: 0.72rem; }

@media (max-width: 900px) {
  .site-header { padding-top: 22px; padding-bottom: 20px; }
  main { padding-top: 22px; }
  .simulation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px), (max-height: 500px) and (orientation: landscape) {
  .site-header { align-items: center; padding: 10px 18px; }
  .eyebrow { display: none; }
  h1 { font-size: 1.65rem; }
  .subtitle { margin-top: 4px; font-size: 0.72rem; }
  .language-control label { display: none; }
  select { min-height: 34px; }
  main { padding: 12px 18px 20px; }
  .intro { display: none; }
  .simulation-grid { grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 5px; }
  .image-placeholder { aspect-ratio: 2.2 / 1; }
  .card-body { min-height: 150px; padding: 11px; }
  .card-body h2 { font-size: 1.1rem; }
  .description { margin-top: 5px; font-size: 0.68rem; line-height: 1.35; }
  .card-footer { padding-top: 8px; }
  .languages { font-size: 0.55rem; }
  .card-footer a { min-width: 60px; padding: 5px 7px; font-size: 0.65rem; }
  footer { display: none; }
}

@media (max-width: 620px) and (orientation: portrait) {
  .simulation-grid { grid-template-columns: 1fr; overflow: visible; }
}
