@font-face {
  font-family: 'Besley';
  src: url('../fonts/besley-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: 'Familjen Grotesk';
  src: url('../fonts/familjen-grotesk-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --segeltuch: #F3F5F4;
  --granit: #C9BFB8;
  --granit-hell: #E6E1DD;
  --zierstreifen: #1B3A5C;
  --tiefwasser: #0F2233;
  --mahagoni: #7A3524;

  --font-display: 'Besley', Georgia, 'Times New Roman', serif;
  --font-text: 'Familjen Grotesk', 'Segoe UI', Arial, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --section-gap: clamp(3.5rem, 9vw, 7.5rem);
}

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

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

body {
  margin: 0;
  background: var(--segeltuch);
  color: var(--tiefwasser);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.55;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--zierstreifen);
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.4rem;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--mahagoni);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--mahagoni);
  outline-offset: 3px;
}

.wrap {
  width: min(100%, 76rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.note {
  font-size: 0.95rem;
  opacity: 0.8;
  margin: 1.5rem 0 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--tiefwasser);
  color: var(--segeltuch);
}

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

/* Kopfzeile */

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 2rem;
  padding-block: 0.75rem;
}

.site-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--zierstreifen);
  text-decoration: none;
  padding-block: 0.6rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--tiefwasser);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

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

/* Hero */

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(82vh, 52rem);
  background: var(--zierstreifen);
  color: var(--segeltuch);
  overflow: hidden;
}

.photo.hero__photo {
  position: absolute;
  inset: 0;
  background: none;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(15 34 51 / 0.82), rgb(15 34 51 / 0) 58%);
}

.hero__text {
  position: relative;
  padding-block: clamp(2rem, 6vw, 4.5rem);
}

.hero h1 {
  color: inherit;
  font-size: clamp(3.6rem, 1.2rem + 13vw, 11rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.hero__sub {
  max-width: 34ch;
  margin: clamp(1.25rem, 3.5vw, 3rem) 0 0;
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  line-height: 1.3;
}

/* Fotos und Platzhalter */

.photo {
  position: relative;
  display: block;
  margin: 0;
  background: var(--granit-hell);
  overflow: hidden;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo--portrait {
  aspect-ratio: 4 / 5;
}

.photo.is-missing img {
  visibility: hidden;
}

.photo.is-missing::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--tiefwasser);
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgb(15 34 51 / 0.06) 14px 15px);
}

.hero__photo.is-missing::before {
  place-items: start end;
  color: var(--granit);
  background: none;
}

.hero__photo.is-missing::after {
  content: none;
}

/* Abschnitte */

.section {
  padding-block: var(--section-gap);
}

.section--tint {
  background: var(--granit-hell);
}

.section--tint .photo {
  background: var(--granit);
}

.prose {
  max-width: 62ch;
}

.split {
  display: grid;
  gap: 2.5rem;
}

/* Eckdaten */

.facts,
.dims {
  margin: 0;
}

.facts > div,
.dims > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--granit);
}

.facts > div:last-of-type,
.dims > div:last-of-type {
  border-bottom: 1px solid var(--granit);
}

.facts dt,
.dims dt {
  flex: none;
}

.facts dd,
.dims dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Seitenriss */

.drawing {
  background: var(--zierstreifen);
  color: var(--segeltuch);
}

.drawing h2 {
  color: inherit;
}

.drawing__grid {
  display: grid;
  gap: 2.5rem;
}

.drawing__text {
  max-width: 34rem;
}

.dims {
  margin-top: 2rem;
}

.dims > div,
.dims > div:last-of-type {
  border-color: rgb(243 245 244 / 0.28);
}

.riss {
  width: 100%;
  max-width: 34rem;
  justify-self: center;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Alle Linien tragen pathLength="1"; Strichmuster und Versatz werden vererbt */
  stroke-dasharray: 1;
}

.riss__water,
.riss__centre {
  stroke: rgb(243 245 244 / 0.35);
  stroke-width: 1.5;
  stroke-dasharray: 2 8;
}

.riss__rig {
  stroke: var(--segeltuch);
  stroke-width: 2.5;
}

.riss__sails {
  stroke: rgb(243 245 244 / 0.5);
  stroke-width: 1.5;
}

.riss__deck {
  stroke: var(--segeltuch);
  stroke-width: 2.5;
}

.riss__hull {
  fill: rgb(15 34 51 / 0.75);
  stroke: var(--segeltuch);
  stroke-width: 3;
}

.riss__topsides {
  fill: var(--segeltuch);
}

.riss__stripe {
  stroke: var(--zierstreifen);
  stroke-width: 4;
}

.riss__plan {
  stroke: var(--segeltuch);
  stroke-width: 3;
}

.riss__dim {
  stroke: var(--granit);
  stroke-width: 1.5;
}

.riss__label {
  fill: var(--segeltuch);
  font-family: var(--font-text);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

/* Zeichnet sich einmal, sobald der Riss ins Bild kommt (Klasse aus main.js) */

.js .riss:not(.is-drawn) {
  stroke-dashoffset: 1;
}

.js .riss:not(.is-drawn) .riss__label,
.js .riss:not(.is-drawn) .riss__topsides {
  opacity: 0;
}

.js .riss.is-drawn {
  animation: riss-draw 1.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.js .riss.is-drawn .riss__dim {
  animation: riss-draw 1.2s 1s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.js .riss.is-drawn .riss__topsides {
  animation: riss-fade 0.8s 0.8s backwards;
}

.js .riss.is-drawn .riss__label {
  animation: riss-fade 0.6s 1.8s backwards;
}

@keyframes riss-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes riss-fade {
  from {
    opacity: 0;
  }
}

/* Technische Daten */

.data {
  display: grid;
  gap: 3rem;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

caption {
  caption-side: bottom;
  padding-top: 1rem;
  text-align: left;
  font-size: 0.95rem;
  opacity: 0.8;
}

th,
td {
  padding: 0.7rem 0;
  border-top: 1px solid var(--granit);
  text-align: left;
  vertical-align: baseline;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 1px solid var(--granit);
}

th {
  width: 46%;
  padding-right: 1rem;
  font-weight: 400;
}

td {
  font-weight: 600;
}

.typ {
  margin-left: 0.4em;
  padding: 0.05em 0.45em;
  border: 1px solid var(--granit);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 400;
  white-space: nowrap;
}

.ratios dl {
  display: grid;
  gap: 1.5rem;
  margin: 0;
}

.ratios dt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.ratios dt b {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--mahagoni);
  white-space: nowrap;
}

.ratios dd {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  max-width: 48ch;
}

/* Originalriss */

.plan {
  margin: 0;
}

.plan img {
  border: 1px solid var(--granit);
}

.plan figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  max-width: 58ch;
}

/* Galerie */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: clamp(9rem, 24vw, 18rem);
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery__item--wide {
  grid-column: span 2;
}

.shot {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  font: inherit;
  cursor: zoom-in;
}

.shot:disabled {
  cursor: default;
}

.shot img {
  transition: transform 0.25s ease-out;
}

.shot:hover:not(:disabled) img {
  transform: scale(1.03);
}

/* Bildansicht */

.lightbox {
  width: min(96vw, 80rem);
  max-height: 96vh;
  padding: 0;
  border: 0;
  background: var(--tiefwasser);
  color: var(--segeltuch);
}

.lightbox::backdrop {
  background: rgb(15 34 51 / 0.85);
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.lightbox figcaption {
  padding: 0.75rem 1rem 0;
}

.lightbox__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
}

.lightbox__bar button {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--granit);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.lightbox__bar button:hover {
  background: rgb(243 245 244 / 0.12);
}

.lightbox__bar [data-close] {
  margin-left: auto;
}

.lightbox :focus-visible {
  outline-color: var(--segeltuch);
}

/* Fußzeile */

.site-footer {
  padding-block: 3rem;
  background: var(--tiefwasser);
  color: var(--segeltuch);
  font-size: 1rem;
}

.site-footer h2 {
  color: inherit;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.site-footer a {
  color: inherit;
}

.site-footer ul {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}

.site-footer__grid {
  display: grid;
  gap: 2rem;
}

.site-footer :focus-visible,
.drawing :focus-visible {
  outline-color: var(--segeltuch);
}

/* Ab Tablet */

@media (min-width: 48rem) {
  .split {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: start;
  }

  .split--media {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  }

  .drawing__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: center;
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }

  .site-footer__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2.5rem, 6vw, 6rem);
  }
}

@media (min-width: 64rem) {
  .data {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(3rem, 7vw, 7rem);
  }

  .ratios {
    padding-top: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .riss.is-drawn,
  .js .riss.is-drawn .riss__dim,
  .js .riss.is-drawn .riss__label,
  .js .riss.is-drawn .riss__topsides {
    animation: none;
  }

  .shot img {
    transition: none;
  }
}
