:root {
  color-scheme: light dark;
  --canvas: light-dark(#f8f9f1, #141613);
  --paper: light-dark(#20251b, #f2f2e9);
  --muted: light-dark(#4e5848, #bfc5b7);
  --accent: light-dark(#435914, #e1fa73);
  --line: light-dark(#ccd2c3, #383d33);
  --surface: light-dark(#edf0e4, #1c2018);
  --icon-border: light-dark(#b9c798, #4b542c);
  --icon-surface: light-dark(#e3ebd1, #28321c);
  font-size: max(18px, 112.5%);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] { color-scheme: light; }

:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: clamp(1.25rem, 5vw, 5rem);
  background: var(--canvas);
  color: var(--paper);
}

.profile {
  width: min(100%, 78rem);
  margin-inline: auto;
  border-bottom: 1px solid var(--line);
}

.identity,
.projects,
.career {
  padding: clamp(1.5rem, 4vw, 4rem) clamp(0.75rem, 4vw, 4rem);
}

.identity { position: relative; }

.theme-toggle {
  position: absolute;
  inset-block-start: clamp(1.5rem, 4vw, 4rem);
  inset-inline-end: clamp(0.75rem, 4vw, 4rem);
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.theme-toggle:hover { border-color: currentColor; }

.theme-toggle::before { content: "☾" / ""; }

:root[data-theme="dark"] .theme-toggle::before { content: "☀︎" / ""; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle::before { content: "☀︎" / ""; }
}

.identity > .monogram,
.case-intro nav { padding-inline-end: 3rem; }

.monogram {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.12em;
  line-height: 1;
}

.monogram span { color: var(--accent); }

h1 {
  margin: 0.625rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.045em;
  line-height: 1.1;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.identity p {
  max-width: 62ch;
  font-size: 1.125rem;
}

.identity .contact-link { margin-top: 1rem; }

.projects,
.career { border-top: 1px solid var(--line); }

h2 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.project-list li {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.career-timeline {
  position: relative;
  display: grid;
  max-width: 60rem;
  gap: 1rem;
  margin: 0;
  padding: 0 0 0 1.5rem;
  list-style: none;
}

.career-timeline::before {
  content: "";
  position: absolute;
  inset: 1.5rem auto 1.5rem 0.25rem;
  width: 1px;
  background: var(--line);
}

.career-entry {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.875rem 1.5rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--surface);
}

.career-entry::before {
  content: "";
  position: absolute;
  top: 1.45rem;
  left: -1.25rem;
  width: 0.55rem;
  height: 0.55rem;
  transform: translateX(-50%);
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: var(--canvas);
}

.career-entry--current::before {
  border-color: var(--accent);
  background: var(--accent);
}

.career-entry > div {
  flex: 1 1 22rem;
  min-width: 0;
}

.career-period {
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.career-period strong { color: var(--accent); }

.career-logo {
  display: block;
  width: 10rem;
  max-width: 100%;
  height: 4rem;
  padding: 0.375rem 0.65rem;
  border-radius: 0.5rem;
  background: #fff;
  object-fit: contain;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover { color: var(--paper); }

a:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.case-intro nav { margin-bottom: 1.5rem; }

.client-screenshot {
  display: block;
  width: min(100%, 24rem);
  height: auto;
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.875rem;
}

.client-link {
  color: inherit;
  text-decoration: none;
}

.client-link:hover { text-decoration: underline; }

.client-link-icon {
  position: relative;
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  margin-inline-start: 0.65rem;
  vertical-align: middle;
  color: var(--accent);
  transform: rotate(-40deg);
}

.client-link-icon::before,
.client-link-icon::after {
  content: "";
  position: absolute;
  top: 0.55rem;
  width: 1rem;
  height: 0.65rem;
  border: 2px solid currentColor;
  border-radius: 1rem;
}

.client-link-icon::before { left: 0; }

.client-link-icon::after { right: 0; }

.case-section,
.case-features {
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(0.75rem, 4vw, 4rem);
  border-top: 1px solid var(--line);
}

.case-section h2 { margin-bottom: 0.75rem; }

.case-section p,
.case-section ul {
  max-width: 65ch;
  color: var(--muted);
  line-height: 1.65;
}

.case-section ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.case-section li + li { margin-top: 0.625rem; }

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--surface);
}

.feature-list-wide { grid-column: 1 / -1; }

.feature-icon {
  position: relative;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  margin-bottom: 0.875rem;
  border: 1px solid var(--icon-border);
  border-radius: 0.65rem;
  background: var(--icon-surface);
  color: var(--accent);
}

.feature-icon::before,
.feature-icon::after {
  position: absolute;
  box-sizing: border-box;
}

.feature-icon--lock::before {
  content: "";
  top: 0.6rem;
  width: 0.65rem;
  height: 0.6rem;
  border: 2px solid;
  border-bottom: 0;
  border-radius: 0.375rem 0.375rem 0 0;
}

.feature-icon--lock::after {
  content: "";
  top: 1.12rem;
  width: 1.05rem;
  height: 0.85rem;
  border: 2px solid;
  border-radius: 0.2rem;
}

.feature-icon--calendar::before,
.feature-icon--booking::before {
  content: "";
  width: 1.15rem;
  height: 1.05rem;
  border: 2px solid;
  border-radius: 0.2rem;
  background: linear-gradient(currentColor, currentColor) 0 0.2rem / 100% 2px no-repeat;
}

.feature-icon--calendar::after {
  content: "";
  top: 0.65rem;
  left: 1rem;
  width: 2px;
  height: 0.3rem;
  background: currentColor;
  box-shadow: 0.5rem 0 currentColor;
}

.feature-icon--booking::after {
  content: "";
  top: 1.33rem;
  width: 0.48rem;
  height: 0.28rem;
  border: solid;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.feature-icon--customer::before {
  content: "";
  top: 0.58rem;
  width: 0.66rem;
  height: 0.66rem;
  border: 2px solid;
  border-radius: 50%;
}

.feature-icon--customer::after {
  content: "";
  top: 1.35rem;
  width: 1.18rem;
  height: 0.65rem;
  border: 2px solid;
  border-radius: 0.55rem 0.55rem 0.2rem 0.2rem;
}

.feature-icon--statistics::before {
  content: "";
  width: 1.2rem;
  height: 1.05rem;
  border: solid;
  border-width: 0 0 2px 2px;
  background:
    linear-gradient(currentColor, currentColor) 0.16rem bottom / 2px 0.35rem no-repeat,
    linear-gradient(currentColor, currentColor) 0.44rem bottom / 2px 0.58rem no-repeat,
    linear-gradient(currentColor, currentColor) 0.72rem bottom / 2px 0.8rem no-repeat;
}

.feature-icon--search::before {
  content: "";
  top: 0.63rem;
  left: 0.63rem;
  width: 0.93rem;
  height: 0.93rem;
  border: 2px solid;
  border-radius: 50%;
}

.feature-icon--search::after {
  content: "";
  top: 1.5rem;
  left: 1.38rem;
  width: 0.62rem;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.feature-icon--branch::before {
  content: "";
  width: 1.25rem;
  height: 1.35rem;
  background:
    linear-gradient(currentColor, currentColor) center top / 2px 50% no-repeat,
    linear-gradient(currentColor, currentColor) center / calc(100% - 2px) 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 50% no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 50% no-repeat;
}

.feature-icon--invoice::before {
  content: "";
  width: 1.05rem;
  height: 1.3rem;
  border: 2px solid;
  border-radius: 0.15rem;
  background:
    linear-gradient(currentColor, currentColor) center 0.26rem / 0.52rem 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 0.51rem / 0.52rem 2px no-repeat;
}

.feature-icon--chat::before {
  content: "";
  top: 0.7rem;
  width: 1.25rem;
  height: 0.95rem;
  border: 2px solid;
  border-radius: 0.28rem;
}

.feature-icon--chat::after {
  content: "";
  top: 1.53rem;
  left: 0.94rem;
  width: 0.4rem;
  height: 0.35rem;
  border: solid;
  border-width: 0 0 2px 2px;
  background: var(--icon-surface);
  transform: skewY(-35deg);
}

.contact-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.contact-trigger:hover { color: var(--paper); }

.contact-dialog {
  width: min(28rem, calc(100% - 1rem));
  max-height: calc(100% - 1rem);
  padding: clamp(0.75rem, 4vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--canvas);
  color: var(--paper);
}

.contact-dialog::backdrop { background: rgb(0 0 0 / 60%); }

.contact-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.contact-dialog-header h2 { margin: 0; }

.contact-close,
.contact-reveal {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}

.contact-close {
  min-width: 2.5rem;
  font-size: 1.4rem;
}

.contact-reveal:not(:disabled) { color: var(--accent); }

.contact-reveal:disabled {
  color: var(--muted);
  cursor: default;
}

.contact-dialog button:focus-visible,
.contact-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.contact-address {
  margin-block: 0.75rem;
  overflow-wrap: anywhere;
}

.contact-challenge:empty { display: none; }
.contact-challenge:not(:empty) { margin-bottom: 0.75rem; }
.contact-status:not(:empty) { margin-top: 0.75rem; }
