/* Front page and tool pages (web/pages/: layout.html around front.html or tool.html, both opening
   with hero.html; convert.html builds on this file too). Same paper, graphite and drafting-board
   grey as the app; headings are set in osifont like the lettering on a drawing. Built for a
   builder on a phone (D41): one dark button, large text, one idea per section. The drop zone is a
   drawing sheet lying on the board, with a title block saying what the site promises; the steps
   are numbered like details on a sheet; the measure colour appears once, on the measured line. */

body.home {
  font-size: 18px;
  line-height: 1.5;
  height: auto;
}

.home h2 { font: 400 clamp(27px, 3.6vw, 38px)/1.15 var(--lettering); letter-spacing: 0.01em; }
.home h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.home p { margin: 0 0 14px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 18px; padding-right: 18px; }

.section { padding-top: clamp(48px, 8vw, 96px); }
.section > h2 { margin-bottom: 24px; max-width: 24ch; }

.lead { font-size: clamp(19px, 2vw, 22px); line-height: 1.45; max-width: 36em; color: var(--graphite); }
.hint { color: var(--pencil); font-size: 15px; }

.home a:not(.button):hover { text-decoration-thickness: 2px; }

/* ---- Buttons ---- */

.home .button { text-decoration: none; }
.button.big { min-height: 50px; padding: 10px 22px; font-size: 17px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 14px; }

/* ---- Header: the name and the language, nothing else ---- */

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; }
/* Every link in the header and footer is at least 44 px high, a thumb's width on a site. */
.bar .brand { display: inline-flex; align-items: center; min-height: 44px; font-size: 21px; }

/* The public pages' EN/ET switch: links, the current language as text. */
nav.language a, nav.language span {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  font-size: 16px;
  text-decoration: none;
  color: var(--pencil);
}
nav.language :first-child { border-radius: 3px 0 0 3px; }
nav.language :last-child { border-radius: 0 3px 3px 0; margin-left: -1px; }
nav.language span { color: var(--graphite); border-color: var(--graphite); position: relative; }
nav.language a:hover { color: var(--graphite); }

/* ---- Hero: what the page does, beside the sheet the file is opened from ---- */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  grid-template-rows: 1fr 1fr;
  grid-template-areas: "title drop" "lead drop";
  column-gap: clamp(28px, 5vw, 72px);
  padding-top: clamp(20px, 5vw, 64px);
}
.hero h1 {
  grid-area: title;
  align-self: end;
  font: 400 clamp(34px, 4.8vw, 62px)/1.06 var(--lettering);
  letter-spacing: 0.005em;
  max-width: 16ch;
  margin: clamp(0px, 3vw, 40px) 0 20px;
}
.hero .lead { grid-area: lead; align-self: start; margin: 0; }
.hero-drop { grid-area: drop; align-self: start; background: var(--board); padding: clamp(14px, 2.4vw, 30px); border-radius: 4px; }

.sheet {
  background: var(--paper);
  padding: 10px;
  border-radius: 2px;
  box-shadow: 0 1px 0 var(--pencil), 0 18px 36px -24px rgb(38 42 46 / 0.5);
}

/* The whole sheet opens the picker, not only its button. Scoped to .sheet: convert.html has its
   own .drop and loads this file too. */
.sheet .drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: clamp(170px, 20vw, 240px);
  padding: 26px 22px;
  border: 1.5px solid var(--graphite);
  border-bottom-width: 1px;
  text-align: center;
  cursor: pointer;
}
/* The dashed rectangle is where the file goes; it darkens while a file is dragged over the page. */
.sheet .drop::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px dashed var(--rule);
  border-radius: 2px;
  pointer-events: none;
}
.sheet .drop:hover::before { border-color: var(--pencil); }
.sheet .drop.dragging { background: var(--wash); }
.sheet .drop.dragging::before { border-color: var(--graphite); }
.sheet .drop:has(.file-input:focus-visible) { outline: 2px solid var(--selection); outline-offset: 2px; }
.sheet .drop .button { position: relative; width: 100%; max-width: 320px; min-height: 58px; justify-content: center; font-size: 20px; }
.sheet .drop:hover .button { background: #000000; }
.drop-files { position: relative; font: 400 19px/1.2 var(--lettering); }
.drop-hint { position: relative; color: var(--pencil); font-size: 15px; }

/* Hidden from view, not from the keyboard: Tab reaches it and Enter opens the picker. */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* The title block under the sheet: what is free, written once. */
.title-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1.5px solid var(--graphite);
  border-top: 0;
}
.title-strip li { padding: 9px 10px 10px; font: 400 16px/1.2 var(--lettering); min-width: 0; }
.title-strip li:nth-child(even) { border-left: 1px solid var(--graphite); }
.title-strip li:nth-child(n + 3) { border-top: 1px solid var(--graphite); }

.sheet .drop-status { margin: 12px 2px 2px; font-size: 16px; }
/* The sample drawing: a quiet text link under the sheet's title block, not a second button. */
.sheet .sample { margin: 4px 2px 0; font-size: 16px; text-align: center; color: var(--pencil); }
.sample a { display: inline-flex; align-items: center; min-height: 44px; color: var(--graphite); }
.drop-status:empty { display: none; }
.drop-status.error { font-weight: 600; }
/* The 3D viewer's "This model is large" question, asked on the page the model is chosen on. */
.home .big-model h2 { font-size: 24px; margin-bottom: 10px; }
.big-model p { font-size: 16px; }
.big-model button { min-height: 44px; }

.hero-drop .promise { margin: 14px 2px 0; font-size: 16px; line-height: 1.45; }

/* The page for an address that does not exist. */
.missing { padding-top: clamp(20px, 5vw, 64px); }
.missing h1 { margin-top: 0; }

/* ---- How it works: three numbered details, each a small drawing ---- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.steps li { position: relative; }
.steps img { display: block; width: 120px; height: 120px; margin-bottom: 14px; }
.axis {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--graphite);
  border-radius: 50%;
  background: var(--paper);
  font: 400 21px/1 var(--lettering);
}
.steps .axis { position: absolute; left: -6px; top: -6px; }
.steps h3 { margin-bottom: 6px; }
.steps p { max-width: 30ch; }
/* Steps without a drawing (the converter pages): the number leads. */
.steps li:not(:has(img)) .axis { position: static; margin-bottom: 14px; }

/* ---- Formats (convert.html) ---- */

.formats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--graphite); }
.formats article { padding: 24px 28px 8px 0; }
.formats article + article { padding-left: 28px; border-left: 1px solid var(--rule); }

/* ---- Tools: a drawing register, one line per tool ---- */

/* The front page's list is not a menu to choose from: the big button picks the viewer. */
.tools-note { max-width: 36em; margin-bottom: 22px; }

.register { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--graphite); max-width: 760px; }
.register a {
  display: grid;
  gap: 2px;
  padding: 14px 6px 15px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.register a:hover { background: var(--wash); }
.register a:hover .register-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.register-name { font: 400 clamp(23px, 2.2vw, 27px)/1.2 var(--lettering); }
.register-text { color: var(--pencil); font-size: 17px; }

/* ---- Pricing (converter pages only): laid out like a drawing's title block ---- */

.pricing .lead { margin-bottom: 32px; }
.title-block { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 2px solid var(--graphite); }
/* Payments off: only the free offer, at the width of one column. */
.title-block:has(.offer[hidden]) { max-width: 420px; }
.offer { padding: 22px 24px 10px; }
.offer + .offer { border-left: 1px solid var(--graphite); }
.offer h3 { font-size: 17px; }
.offer .price { font: 400 clamp(44px, 5vw, 60px)/1 var(--lettering); margin: 18px 0 4px; }
.offer .term { color: var(--pencil); font-size: 15px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.offer p:last-child { font-size: 16px; }
.pricing > .hint { margin-top: 16px; max-width: 48em; }

/* ---- Questions: asked and answered in plain view ---- */

.questions { border-top: 2px solid var(--graphite); max-width: 46em; }
.questions h3 { padding-top: 20px; margin-bottom: 6px; }
.questions p { padding-bottom: 18px; margin: 0; border-bottom: 1px solid var(--rule); }
.questions p:has(+ p) { border-bottom: 0; padding-bottom: 8px; }
/* A link in an answer stays a text link; its padding makes the tap at least 44 px high
   without moving the lines. */
.questions a { padding-block: 12px; }

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

.trust { background: var(--graphite); color: var(--paper); margin-top: clamp(48px, 8vw, 96px); }
.trust-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(20px, 6vw, 88px);
  padding-top: clamp(44px, 7vw, 88px);
  padding-bottom: clamp(40px, 6vw, 72px);
}
.trust h2 { max-width: 14ch; }
.trust p { max-width: 34em; color: #e6e9ec; }
.trust .promise-big { font: 400 clamp(22px, 2.4vw, 28px)/1.3 var(--lettering); color: var(--paper); margin-bottom: 20px; }

/* ---- Footer: who, and the legal pages ---- */

.page-footer { border-top: 1px solid var(--rule); margin-top: clamp(48px, 8vw, 96px); font-size: 16px; }
main:has(> .trust:last-child) + .page-footer { margin-top: 0; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 24px 48px;
  padding-top: 32px;
  padding-bottom: 40px;
}
.footer-about .brand { font-size: 19px; margin-bottom: 8px; }
.footer-about p:not(.brand) { color: var(--pencil); max-width: 36em; }
.footer-legal { display: flex; flex-wrap: wrap; align-content: start; gap: 0 22px; }
.footer-legal a { display: inline-flex; align-items: center; min-height: 44px; color: var(--pencil); }
.footer-legal a:hover { color: var(--graphite); }
.legal-note { flex-basis: 100%; color: var(--pencil); font-size: 15px; }

/* convert.html's footer */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 28px; padding-bottom: 36px; }
.site-footer .legal { gap: 8px 22px; padding: 0; margin: 0; font-size: 15px; }
.site-footer .legal a { color: var(--pencil); }
.site-footer .legal a:hover { color: var(--graphite); }

/* ---- Touch screens and narrow screens ---- */

@media (hover: none) {
  .drop-hint { display: none; }
}

@media (min-width: 761px) {
  body.home { font-size: 19px; }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "title" "lead" "drop"; }
  .trust-inner { grid-template-columns: 1fr; }
  .hero h1 { max-width: 20ch; margin: 0 0 10px; }
  .hero .lead { margin-bottom: 18px; }
  .title-block { grid-auto-flow: row; }
  .offer + .offer { border-left: 0; border-top: 1px solid var(--graphite); }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero-grid { padding-top: 22px; }
  .hero-drop { margin: 0 -16px; border-radius: 0; padding: 14px 16px 16px; }
  .sheet .drop { min-height: 150px; padding: 22px 16px; }

  /* A detail beside its words, one under the other. */
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .steps li { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 18px; align-items: start; }
  .steps img { width: 96px; height: 96px; margin: 0; grid-row: 1 / span 2; }
  .steps li:not(:has(img)) { grid-template-columns: 40px minmax(0, 1fr); }
  .steps li:not(:has(img)) .axis { grid-row: 1 / span 2; margin: 0; }
  .steps h3 { margin-top: 8px; }

  .formats { grid-template-columns: 1fr; }
  .formats article, .formats article + article { padding: 22px 0 6px; border-left: 0; }
  .formats article + article { border-top: 1px solid var(--rule); }

  .actions .button.big { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 400px) {
  .bar .brand { font-size: 19px; }
  .hero h1 { font-size: 33px; }
}
