/* Shared Swiss portfolio system for wsiener.dev. */
:root {
  color-scheme: light;
  --surface: #FFFFFF;
  --surface-soft: #F7F7F8;
  --ink: #111216;
  --muted: #62646C;
  --rule: #D7D8DD;
  --accent: #002FA7;
  --accent-text: #002FA7;
  --on-accent: #FFFFFF;
}

html[data-mode="dark"] {
  color-scheme: dark;
  --surface: #101114;
  --surface-soft: #18191E;
  --ink: #F7F7F8;
  --muted: #B2B4BC;
  --rule: #393B43;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 4px;
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3rem;
  padding: 0 max(1rem, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--rule);
  background: var(--surface-soft);
  font-size: 0.76rem;
}

.preview-bar span {
  margin-right: auto;
  font-weight: 700;
}

.preview-bar a {
  color: var(--muted);
}

.preview-bar a:hover {
  color: var(--accent-text);
}

.site-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 3rem);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 7.5rem;
  gap: 3rem;
  border-bottom: 1px solid var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1.5rem, 3vw, 3rem);
}

.identity {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  text-decoration: none;
}

.identity strong {
  font-size: 1.35rem;
  letter-spacing: -0.045em;
}

.identity span {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(1.25rem, 3vw, 3.25rem);
}

.site-nav a {
  font-size: 0.86rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.preferences {
  position: relative;
}

.preferences-toggle {
  display: none;
}

.preferences-panel {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface-soft);
}

.preferences-panel button,
.accent-control {
  min-height: 2.1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
}

.preferences-panel button {
  position: relative;
  padding: 0 0.75rem 0 1.65rem;
  cursor: pointer;
}

.preferences-panel button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.65rem;
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid var(--muted);
  border-radius: 50%;
  transform: translateY(-50%);
}

.preferences-panel button:hover {
  background: var(--surface);
  color: var(--ink);
}

.preferences-panel button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
}

.preferences-panel button[aria-pressed="true"]::before {
  border-color: var(--accent-text);
  background: var(--accent);
}

.accent-control {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.3rem 0 0.65rem;
  cursor: pointer;
}

.accent-control input {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.accent-control input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.accent-control input::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}

.accent-control input::-moz-color-swatch {
  border: 0;
  border-radius: 50%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 0.75fr);
  min-height: 32rem;
  border-bottom: 1px solid var(--ink);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 6vw, 7rem) clamp(4rem, 8vw, 8rem) 0;
  border-right: 1px solid var(--rule);
}

.domain,
.question-label,
.project-kind {
  margin: 0;
  color: var(--accent-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 15ch;
  margin: 1.4rem 0 1.75rem;
  font-size: clamp(3rem, 5.4vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.96;
}

.intro {
  max-width: 49rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.working-question {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 4vw, 4rem);
  background: var(--surface-soft);
}

.question {
  margin: 1.5rem 0;
  font-size: clamp(1.55rem, 2.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.question-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.work-section,
.inquiries-section {
  padding: clamp(4rem, 7vw, 7rem) 0;
}

.work-section {
  border-bottom: 1px solid var(--ink);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 3rem;
}

.section-heading h2,
.studies-panel h2 {
  margin: 0;
  font-size: clamp(1.7rem, 2.6vw, 2.7rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.section-heading > p {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
}

.project-card {
  position: relative;
  display: flex;
  min-height: 30rem;
  flex-direction: column;
  padding: clamp(2rem, 4vw, 4rem);
  overflow: hidden;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.project-number {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  color: var(--accent-text);
  font-size: clamp(4.5rem, 8vw, 8.5rem);
  font-weight: 700;
  letter-spacing: -0.09em;
  line-height: 0.8;
  opacity: 0.12;
}

.project-card h3 {
  position: relative;
  margin: auto 0 1.5rem;
  font-size: clamp(2.5rem, 4.2vw, 4.6rem);
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.project-card > p:not(.project-kind) {
  position: relative;
  max-width: 38rem;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1rem;
}

.project-action {
  position: relative;
  align-self: flex-start;
  padding: 0.9rem 1.1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
}

.project-card:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.project-card:hover .project-kind,
.project-card:hover > p:not(.project-kind) {
  color: var(--on-accent);
}

.project-card:hover .project-number {
  color: var(--on-accent);
  opacity: 0.16;
}

.project-card:hover .project-action {
  background: var(--surface);
  color: var(--accent-text);
  text-decoration-color: currentColor;
}

.framework-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8rem, 0.45fr) minmax(0, 1.55fr);
  gap: clamp(2rem, 5vw, 6rem);
  min-height: 22rem;
  padding: clamp(2rem, 5vw, 5rem);
  overflow: hidden;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  background: var(--surface-soft);
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.framework-number {
  color: var(--accent-text);
  font-size: clamp(5rem, 10vw, 10rem);
  font-weight: 700;
  letter-spacing: -0.09em;
  line-height: 0.8;
  opacity: 0.16;
}

.framework-feature h3 {
  max-width: 14ch;
  margin: 1rem 0 1.5rem;
  font-size: clamp(2.3rem, 4vw, 4.5rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.framework-feature div > p:not(.project-kind) {
  max-width: 47rem;
  margin: 0 0 2rem;
  color: var(--muted);
}

.framework-feature:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.framework-feature:hover .project-kind,
.framework-feature:hover div > p:not(.project-kind),
.framework-feature:hover .framework-number {
  color: var(--on-accent);
}

.framework-feature:hover .project-action {
  background: var(--surface);
  color: var(--accent-text);
  text-decoration-color: currentColor;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 0.65fr);
  border-bottom: 1px solid var(--ink);
}

.inquiries-section {
  padding-right: clamp(2rem, 6vw, 7rem);
  border-right: 1px solid var(--rule);
}

.inquiry-list {
  border-top: 1px solid var(--ink);
}

.inquiry-list article {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.inquiry-number {
  margin: 0;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.inquiry-list h3 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
}

.inquiry-list article div p {
  max-width: 43rem;
  margin: 0;
  color: var(--muted);
}

.studies-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(3rem, 5vw, 5rem);
  background: var(--surface-soft);
}

.study-count {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 clamp(3rem, 5vw, 5rem);
  color: var(--accent-text);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.study-count span {
  font-size: 1.25rem;
  letter-spacing: -0.05em;
}

.studies-heading p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.studies-panel a {
  display: block;
  margin-top: auto;
  padding: 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-align: center;
}

.studies-panel a:hover {
  background: var(--ink);
  color: var(--surface);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.site-footer p {
  margin: 0;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.25rem;
}

@media (max-width: 850px) {
  .masthead,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .inquiries-section {
    padding-right: 0;
    border-right: 0;
  }

  .working-question,
  .studies-panel {
    min-height: 20rem;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 620px) {
  .masthead {
    position: relative;
    min-height: 0;
    gap: 1.4rem;
    padding: 1.4rem 0 1.25rem;
  }

  .header-actions {
    width: 100%;
  }

  .preview-bar {
    overflow-x: auto;
  }

  .preview-bar span {
    display: none;
  }

  .preview-bar a {
    flex: 0 0 auto;
  }

  .identity {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .preferences {
    position: absolute;
    top: 1.35rem;
    right: 0;
  }

  .preferences-toggle {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    place-items: center;
  }

  .preferences-toggle:hover,
  .preferences-toggle[aria-expanded="true"] {
    border-color: var(--ink);
    color: var(--ink);
  }

  .preferences-toggle:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
  }

  .preferences-toggle svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
  }

  .preferences-panel {
    display: none;
    position: absolute;
    z-index: 10;
    top: calc(100% + 0.5rem);
    right: 0;
    width: max-content;
    background: var(--surface);
  }

  .preferences.is-open .preferences-panel {
    display: flex;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 14vw, 4.3rem);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .framework-feature {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 27rem;
  }

}

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

  .project-card {
    transition: none;
  }
}
