/* Autotalo Ylinen — koko ulkoasu. Värit logo-ohjeistuksesta (Totetec 23.3.2026). */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* brändi */
  --black: #000;
  --white: #fff;
  --gold: #b98410;
  --red: #9c0621;
  /* johdetut */
  --gold-hi: #d6a032;
  --red-hi: #b50b2a;
  --stone: #ededea;
  --ink: #000;
  --ink-2: #53534e;
  --smoke: #a8a8a2;
  --line: rgba(0, 0, 0, 0.13);
  --line-dark: rgba(255, 255, 255, 0.16);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wide: 125%;
  --wrap: 90rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;
  --header-h: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-stretch: var(--wide); font-weight: 800; line-height: 1.02; letter-spacing: -0.012em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); }
h3 { font-size: 1.25rem; line-height: 1.15; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--gold); color: var(--black); padding: .6rem 1rem; font-weight: 700; }
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.lede { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.5; max-width: 38rem; }

/* ---------- painikkeet ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 3.25rem; padding: .85rem 1.4rem;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.1; text-decoration: none;
  border: 2px solid transparent; border-radius: var(--radius); cursor: pointer;
  transition: background-color .18s, color .18s, border-color .18s;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn--call { background: var(--red); color: var(--white); }
.btn--call:hover { background: var(--red-hi); }
.btn--ghost { border-color: var(--gold); color: var(--gold-hi); }
.btn--ghost:hover { background: var(--gold); color: var(--black); }
.btn--ink { background: var(--black); color: var(--white); }
.btn--ink:hover { background: var(--red); }
.btn--line { border-color: var(--black); color: var(--black); }
.btn--line:hover { background: var(--black); color: var(--white); }

/* ---------- ylätunniste ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--black); color: var(--white);
  border-bottom: 1px solid var(--line-dark);
}
.header__in { display: flex; align-items: center; gap: 2rem; height: var(--header-h); }
.header__logo { display: block; width: 8.5rem; flex: none; }
.header__logo img { width: 100%; }
.nav { display: flex; gap: 1.75rem; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--smoke); padding-block: .5rem; }
.nav a:hover { color: var(--white); }
.header__call { min-height: 2.75rem; padding: .55rem 1rem; font-size: .95rem; }
.header__call .num { font-feature-settings: "tnum"; }

/* ---------- hero ---------- */
.hero {
  position: relative; background: var(--black); color: var(--white); overflow: hidden; isolation: isolate;
  --mark-w: clamp(16rem, 30vw, 32rem);
}
/* Logon V-merkki isona, ensinäkymän oikeassa reunassa kokonaan näkyvissä */
.hero__mark {
  position: absolute; z-index: -1; pointer-events: none;
  right: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  top: 50%; translate: 0 -50%;
  width: var(--mark-w); height: auto;
}
/* Teksti ei ulotu V-merkin päälle */
.hero__in { padding-block: clamp(2.75rem, 6vw, 4.5rem) clamp(2.5rem, 4vw, 3.5rem); max-width: min(48rem, 100% - var(--mark-w) - 3rem); }
.hero h1 { font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.9rem); }
.hero .lede { color: #d9d9d4; margin-top: 1.1rem; }
.hero__phone {
  display: inline-block; margin-top: 1.25rem;
  font-stretch: var(--wide); font-weight: 800; font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem);
  line-height: 1; letter-spacing: -.01em; color: var(--gold-hi); text-decoration: none;
  font-feature-settings: "tnum";
}
.hero__phone:hover { color: var(--white); }
.hero__phone small { display: block; font-size: .95rem; font-stretch: 100%; font-weight: 500; letter-spacing: 0; color: var(--smoke); margin-bottom: .6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero__live {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.5rem;
  color: var(--smoke); font-size: .95rem; text-decoration: none;
}
.hero__live:hover { color: var(--white); }
.hero__live[hidden] { display: none; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: #3fbf6a; box-shadow: 0 0 0 0 rgba(63,191,106,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 .5rem rgba(63,191,106,0); } 100% { box-shadow: 0 0 0 0 rgba(63,191,106,0); } }

/* Latausjakso: yksi orkestroitu sisääntulo heroon */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lede, .hero__phone, .hero__actions { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .hero .lede { animation-delay: .08s; }
  .hero__phone { animation-delay: .16s; }
  .hero__actions { animation-delay: .24s; }
  .hero__mark { animation: settle 1.1s cubic-bezier(.2,.7,.2,1) .1s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes settle { from { opacity: 0; transform: translateY(-2.5rem); } }

/* ---------- autot ---------- */
.cars__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; }
.cars__head p { margin: .9rem 0 0; color: var(--ink-2); }
.cars__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 2.5rem 1.75rem; list-style: none; margin: 0; padding: 0; }

.car { position: relative; display: flex; flex-direction: column; }
.car__img { aspect-ratio: 4 / 3; background: var(--stone); border-radius: var(--radius); overflow: hidden; }
.car__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.car:hover .car__img img { transform: scale(1.03); }
.car__body { display: flex; flex-direction: column; flex: 1; padding-top: 1.1rem; }
.car__title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.car__title h3 a { text-decoration: none; }
.car__title h3 a::after { content: ""; position: absolute; inset: 0; } /* koko kortti klikattava */
.car__price { font-stretch: var(--wide); font-weight: 800; font-size: 1.35rem; white-space: nowrap; font-feature-settings: "tnum"; }
.car__sub { color: var(--ink-2); margin: .3rem 0 .9rem; font-size: .95rem; }
.car__specs { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 1rem; padding: .7rem 0; border-block: 1px solid var(--line); font-size: .92rem; font-feature-settings: "tnum"; }
.car__specs div { padding-right: 1rem; margin-right: 1rem; border-right: 1px solid var(--line); }
.car__specs div:last-child { border: 0; margin: 0; padding: 0; }
.car__specs dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.car__specs dd { margin: 0; }
.car__notes { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .35rem; font-size: .95rem; }
.car__notes li { padding-left: 1.1rem; position: relative; }
.car__notes li::before { content: ""; position: absolute; left: 0; top: .6em; width: .45rem; height: .45rem; background: var(--gold); transform: skewX(-18deg); }
.car__vat { display: inline-block; margin-bottom: .75rem; font-size: .8rem; font-weight: 700; padding: .2rem .5rem; background: var(--stone); border-radius: 2px; align-self: flex-start; }
.car__cta { margin-top: auto; font-weight: 700; color: var(--red); }

.car--all { justify-content: center; align-items: flex-start; gap: 1rem; padding: 2rem; background: var(--black); color: var(--white); border-radius: var(--radius); min-height: 18rem; }
.car--all p { color: var(--smoke); margin: 0; }
.car--all h3 { font-size: 1.6rem; }

.car--skeleton .car__img, .car--skeleton .sk { background: linear-gradient(90deg, #eeeeeb 0%, #f7f7f5 50%, #eeeeeb 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.car--skeleton .sk { height: 1rem; border-radius: 2px; margin-top: .8rem; }
.car--skeleton .sk:first-child { width: 70%; height: 1.4rem; }
.car--skeleton .sk:nth-child(2) { width: 45%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.cars__msg { grid-column: 1 / -1; padding: 2rem; background: var(--stone); border-radius: var(--radius); }
.cars__msg h3 { margin-bottom: .6rem; }
.cars__msg p { max-width: 36rem; }
.cars__updated { margin-top: 2rem; font-size: .88rem; color: var(--ink-2); }

/* ---------- palvelut ---------- */
.services { background: var(--stone); }
.services__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.services__media { position: sticky; top: calc(var(--header-h) + 2rem); }
.services__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.services__list { list-style: none; margin: 1.75rem 0 0; padding: 0; }
.services__list li { display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem; padding-block: 1.2rem; border-top: 1px solid var(--line); }
.services__list li:last-child { border-bottom: 1px solid var(--line); }
.services__list h3 { font-size: 1.15rem; }
.services__list p { margin: 0; color: var(--ink-2); }
.services__list a { font-weight: 700; color: var(--red); }

/* ---------- lomake ---------- */
.sell { background: var(--black); color: var(--white); }
.sell__in { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 6rem); }
.sell .lede { color: #d9d9d4; margin-top: 1.25rem; }
.form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.1rem 1rem; }
.field { grid-column: span 6; display: grid; gap: .4rem; }
.field--half { grid-column: span 3; }
.field--third { grid-column: span 2; }
.field label, .form legend { font-size: .9rem; font-weight: 600; color: #d9d9d4; }
.field .opt { font-weight: 400; color: var(--smoke); }
.form input, .form textarea {
  width: 100%; font: inherit; color: var(--white); background: #141414;
  border: 1px solid #3a3a3a; border-radius: var(--radius); padding: .8rem .9rem; min-height: 3.1rem;
}
.form textarea { min-height: 7rem; resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185,132,16,.3); }
.form input::placeholder, .form textarea::placeholder { color: #767672; }
.form fieldset { grid-column: span 6; border: 0; margin: 0; padding: 0; }
.choice { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }
.choice label { cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; min-height: 2.9rem; padding: .6rem 1.1rem; border: 1px solid #3a3a3a; border-radius: var(--radius); font-weight: 600; color: #d9d9d4; }
.choice input:checked + span { border-color: var(--gold); background: var(--gold); color: var(--black); }
.choice input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 3px; }
.form__foot { grid-column: span 6; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: .5rem; }
.form__foot p { margin: 0; font-size: .85rem; color: var(--smoke); max-width: 26rem; }
.form__foot a { color: #d9d9d4; }
.hp { display: none; }

/* ---------- yhteystiedot ---------- */
.contact__in { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.contact__phone { display: inline-block; margin-top: 1.75rem; font-stretch: var(--wide); font-weight: 800; font-size: clamp(2rem, 1.2rem + 3.6vw, 3.8rem); line-height: 1; color: var(--red); text-decoration: none; font-feature-settings: "tnum"; }
.contact__phone:hover { color: var(--black); }
.contact__hours { margin-top: 1.25rem; font-size: 1.1rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.person { display: flex; align-items: center; gap: 1.1rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.person img { width: 5.5rem; height: 5.5rem; border-radius: 50%; object-fit: cover; }
.person strong { display: block; font-size: 1.15rem; }
.person span { color: var(--ink-2); }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding-block: 1rem; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-2); font-size: .95rem; }
.facts dd { margin: 0; font-weight: 600; }
.facts a { text-decoration-color: var(--gold); text-underline-offset: 3px; }

/* ---------- loppu ---------- */
.closing { color: var(--white); background: var(--red); }
.closing__in { padding-block: clamp(2.5rem, 5vw, 4rem); display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 2rem; }
.btn--white { background: var(--white); color: var(--red); }
.btn--white:hover { background: var(--black); color: var(--white); }
.btn--outline-white { border-color: rgba(255,255,255,.7); color: var(--white); }
.btn--outline-white:hover { background: var(--white); color: var(--red); }
.closing h2 { max-width: 14ch; }
.closing__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.footer { background: var(--black); color: var(--smoke); font-size: .95rem; padding-block: 2.5rem 2rem; border-top: 1px solid var(--line-dark); }
.footer__in { display: grid; grid-template-columns: 12rem repeat(3, minmax(0, 1fr)); gap: 2rem; }
.footer__logo { width: 10rem; }
.footer h3 { font-size: .95rem; font-stretch: 100%; font-weight: 700; color: var(--white); margin-bottom: .6rem; letter-spacing: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.footer a { color: var(--smoke); text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; }
.footer__legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-dark); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .85rem; }

/* ---------- mobiilin toimintopalkki ---------- */
.callbar { display: none; }

/* ---------- alasivut ---------- */
.page { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.page .wrap { max-width: 44rem; }
.page h1 { font-size: clamp(2.2rem, 1.4rem + 3.5vw, 3.6rem); margin-bottom: 1.5rem; }
.page h2 { font-size: 1.35rem; margin: 2.5rem 0 .75rem; }
.page p, .page li { color: #2b2b28; }

/* ---------- responsiivisuus ---------- */
@media (max-width: 64rem) {
  .services__in, .sell__in, .contact__in { grid-template-columns: 1fr; }
  .services__media { position: static; }
  .services__media img { aspect-ratio: 16 / 10; }
  .footer__in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 47.99rem) {
  :root { --header-h: 4rem; }
  body { padding-bottom: 4.5rem; }
  .nav { display: none; }
  .header__logo { width: 7rem; }
  .header__call { margin-left: auto; }
  .header__call .label { display: none; }
  .hero__mark { display: none; }
  .hero__in { max-width: none; }
  .hero h1 { font-size: 1.75rem; }
  .contact__actions .btn { flex: 1 1 auto; }
  .hero__actions .btn { flex: 1 1 100%; }
  .services__list li { grid-template-columns: 1fr; gap: .4rem; }
  .field--half, .field--third { grid-column: span 6; }
  .facts div { grid-template-columns: 1fr; gap: .15rem; }
  .footer__in { grid-template-columns: 1fr; }
  .callbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
    position: fixed; inset: auto 0 0 0; z-index: 60; padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom));
    background: rgba(0,0,0,.94); border-top: 1px solid var(--line-dark);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .callbar .btn { min-height: 3rem; padding-inline: .5rem; font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Pienimmät puhelimet (alle 360 px): numero ja painikkeet pysyvät yhdellä rivillä */
@media (max-width: 22.49rem) {
  .header__call { padding-inline: .7rem; font-size: .85rem; white-space: nowrap; }
  .hero h1 { font-size: 1.5rem; }
  .callbar .btn { font-size: .85rem; white-space: nowrap; }
}
