/* Tin Planet Technologies — shared styles
   Colour values come from BUILD_BRIEF.md. */

:root {
  /* Brand palette */
  --paper: #F0EFE9;
  --shell: #D8DAD4;
  --chassis: #B8BAB3;
  --ink: #202320;
  --blue: #244BE6;
  --green: #17845B;
  --yellow: #F1C647;
  --orange: #E45C37;
  --red: #C53C45;
  --purple: #8046A6;

  /* Supporting neutrals taken from homepage-direction.svg */
  --rule: #858A81;
  --muted: #555A53;

  --font-head: "Arimo", Arial, Helvetica, sans-serif;
  --font-body: "Arimo", Arial, Helvetica, sans-serif;
  --font-label: "Cousine", "Courier New", monospace;

  --tracking-tight: -0.028em;
  --gutter: clamp(1rem, 3.5vw, 3rem);
  --shadow: 4px 4px 0 var(--chassis);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.55;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.08;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--blue);
}

/* Keyboard focus: always visible, never removed */
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-family: var(--font-label);
  text-transform: uppercase;
}

.skip-link:focus {
  top: 1rem;
}

.label {
  font-family: var(--font-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Page frame: paper margin around a shell-grey panel ---------- */

.frame {
  margin: clamp(0.5rem, 1.7vw, 1.875rem);
  min-height: calc(100vh - 2 * clamp(0.5rem, 1.7vw, 1.875rem));
  display: flex;
  flex-direction: column;
  background: var(--shell);
  border: 2px solid var(--ink);
}

.wrap {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

main {
  flex: 1;
}

/* ---------- Header ---------- */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: clamp(1.25rem, 2.6vw, 2.25rem);
  padding-bottom: clamp(0.9rem, 1.8vw, 1.5rem);
  position: relative;
}

/* Draw the rule inside the gutters, as in the direction board */

.site-header .wrap::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: block;
  line-height: 0;
}

.brand img {
  width: clamp(190px, 21vw, 340px);
}

.site-nav ul {
  display: flex;
  gap: clamp(1.25rem, 3vw, 3.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-family: var(--font-label);
  font-size: clamp(1rem, 1.3vw, 1.35rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: var(--ink);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--blue);
}

/* ---------- Home: hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.hero-computer img {
  width: 100%;
}

.hero-text h1 {
  font-size: clamp(2.6rem, 5.4vw, 5.9rem);
  line-height: 1.04;
}

.hero-text p {
  margin-top: clamp(1rem, 1.8vw, 1.6rem);
  font-family: var(--font-label);
  font-size: clamp(1rem, 1.35vw, 1.4rem);
  line-height: 1.4;
}

/* ---------- Product cards (Quiet Frame) ---------- */

.products {
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-label {
  font-size: clamp(1rem, 1.4vw, 1.5rem);
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.4vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.quiet-frame {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card__meta {
  padding: 1.1rem clamp(1.1rem, 1.6vw, 1.6rem) 0.9rem;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(0.85rem, 1.05vw, 1.1rem);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.4rem clamp(1.1rem, 1.6vw, 1.6rem) 1.5rem;
}

.product-card h3 {
  font-size: clamp(2rem, 3.2vw, 3.6rem);
}

.product-card__body p {
  margin-top: 0.7rem;
  font-size: clamp(1.05rem, 1.35vw, 1.4rem);
  line-height: 1.4;
}

.product-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 1.4rem;
  font-family: var(--font-label);
  font-size: clamp(0.95rem, 1.2vw, 1.25rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

a.product-link[href] {
  color: var(--blue);
}

/* No URL yet: plain text, not focusable, not clickable */
.product-link:not([href]) {
  color: var(--muted);
  cursor: default;
}

/* ---------- Inner pages ---------- */

.page-intro {
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(1.75rem, 3.5vw, 3rem);
}

.page-intro h1 {
  max-width: 16em;
}

.page-intro .label {
  font-size: clamp(0.9rem, 1.1vw, 1.1rem);
  margin-bottom: 1rem;
}

.page-intro h1 {
  font-size: clamp(2.4rem, 4.8vw, 5rem);
}

.page-intro p {
  margin-top: 1.1rem;
  font-size: clamp(1.1rem, 1.4vw, 1.4rem);
  max-width: 40em;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(1.5rem, 4vw, 4.5rem);
  align-items: start;
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.story {
  display: grid;
  gap: clamp(1.25rem, 2vw, 1.75rem);
}

.story-panel__head {
  padding: 0.9rem 1.4rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}

.story-panel__body {
  padding: 1.2rem 1.4rem 1.4rem;
}

.story-panel h2 {
  font-size: clamp(1.6rem, 2.2vw, 2.25rem);
}

.story-panel__body p {
  margin-top: 0.75rem;
  max-width: 38em;
}

/* Blue screen panel with the five-colour accent planet */
.screen-panel {
  background: var(--chassis);
  border: 2px solid var(--ink);
  padding: clamp(0.75rem, 1.2vw, 1.1rem);
  box-shadow: var(--shadow);
}

.screen-panel__glass {
  background: var(--blue);
  border: 2px solid var(--ink);
  outline: 1px solid var(--rule);
  outline-offset: clamp(0.4rem, 0.6vw, 0.55rem);
  margin: clamp(0.4rem, 0.6vw, 0.55rem);
  padding: clamp(1.5rem, 3vw, 2.75rem) clamp(1rem, 2vw, 2rem) 0;
  color: var(--paper);
}

.screen-panel__glass img {
  width: min(100%, 340px);
  margin: 0 auto clamp(1.5rem, 3vw, 2.75rem);
}

.spectrum-band {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 14px;
  margin-inline: calc(-1 * clamp(1rem, 2vw, 2rem));
}

.spectrum-band span:nth-child(1) { background: var(--green); }
.spectrum-band span:nth-child(2) { background: var(--yellow); }
.spectrum-band span:nth-child(3) { background: var(--orange); }
.spectrum-band span:nth-child(4) { background: var(--red); }
.spectrum-band span:nth-child(5) { background: var(--purple); }
.spectrum-band span:nth-child(6) { background: var(--blue); }

.lockup-card {
  margin-top: clamp(1.25rem, 2vw, 1.75rem);
  padding: 1.25rem 1.4rem;
}

.lockup-card img {
  width: min(100%, 360px);
}

/* ---------- Contact ---------- */

.contact-form {
  padding: clamp(1.25rem, 2.4vw, 2.25rem);
}

.field + .field {
  margin-top: 1.4rem;
}

.field label {
  display: block;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  margin-bottom: 0.45rem;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 0;
}

.field textarea {
  min-height: 11rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.field [aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: inset 4px 0 0 var(--red);
}

.field-error {
  margin-top: 0.4rem;
  color: #A3303A;
  font-size: 0.95rem;
  font-weight: 700;
}

.field-error:empty {
  display: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.75rem;
}

.button {
  font-family: var(--font-label);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.8rem 1.5rem;
  color: var(--paper);
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.button:hover {
  background: #1C3CC0;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.form-status {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 2px solid var(--ink);
  background: var(--shell);
}

.form-status:empty {
  display: none;
}

.form-status[data-state="sent"] {
  box-shadow: inset 6px 0 0 var(--green);
}

.form-status[data-state="error"] {
  border-color: #A3303A;
  box-shadow: inset 6px 0 0 #A3303A;
}

.form-status[data-state="preview"] {
  box-shadow: inset 6px 0 0 var(--blue);
}

.form-status .label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.contact-aside {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 3vw, 3rem) 1.4rem;
}

.contact-aside img {
  width: min(100%, 320px);
}

.form-note {
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* ---------- Privacy ---------- */

.prose {
  padding: clamp(1.25rem, 2.4vw, 2.25rem);
}

.prose h2 {
  font-size: clamp(1.3rem, 1.7vw, 1.6rem);
  margin-top: 2rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin-top: 0.75rem;
  max-width: 40em;
}

.prose-date {
  padding-top: 1.25rem;
  margin-top: 2rem !important;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1rem;
  padding-bottom: 1.25rem;
  position: relative;
  font-family: var(--font-label);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.site-footer a {
  color: inherit;
}

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

.site-footer .wrap::before {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 0;
  border-top: 1px solid var(--rule);
}

/* ---------- Responsive ---------- */

@media (max-width: 60em) {
  .hero {
    grid-template-columns: 1fr;
  }

  /* Headline first on narrower screens, then the simplified screen */
  .hero-text {
    order: -1;
  }

  .hero-computer {
    max-width: 30rem;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 48em) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .screen-panel {
    max-width: 26rem;
  }
}

/* The site has no animation. If any is added later, it must stop here. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
