@font-face {
  font-family: "Inter Headings";
  src: url("../assets/fonts/inter-750-latin.woff2") format("woff2");
  font-weight: 750;
  font-display: swap;
}

@font-face {
  font-family: "Inter Headings";
  src: url("../assets/fonts/inter-750-latin-ext.woff2") format("woff2");
  font-weight: 750;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF;
}

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF;
}

:root {
  color-scheme: light;
  --ink: #0b0b0b;
  --muted: #525252;
  --paper: #f7f7f7;
  --line: #e8e8e8;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; background: #fff; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: "Inter Headings", "Inter", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
button, a[href] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }

.shell {
  width: calc(100% - 2 * clamp(16px, 2.7vw, 54px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 3;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff;
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 22px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
}

.contact-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-icon { flex: none; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: fit-content;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color .18s ease;
}

.button:hover { background: #383838; }
button.button { border: 0; cursor: pointer; }
.header-contact, .more-projects { font-weight: 400; }
.arrow-icon { display: block; flex: none; }

.intro { background: var(--paper); }
.intro-inner { padding-block: 30px 30px; }

.portrait {
  display: block;
  width: clamp(74px, 7.25vw, 108px);
  height: auto;
  aspect-ratio: 1;
  margin-bottom: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #e6e6e6;
}

.intro h1 {
  font-size: clamp(32px, 4.2vw, 62px);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1.09;
  text-wrap: balance;
}

.intro p {
  margin-top: 8px;
  color: #202020;
  font-size: clamp(15px, 1.55vw, 20px);
  line-height: 1.5;
}

.projects { padding-block: 32px 0; scroll-margin-top: 16px; }

.projects > h2 { margin-bottom: 37px; }

.projects h2 {
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 750;
  letter-spacing: -.057em;
  line-height: 1.1;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px clamp(14px, 1.5vw, 24px);
}

.project-link { display: block; border-radius: 15px; }

.project-caption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding-top: 3px;
}

.project-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 30px;
}

.project-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 9px;
  min-width: 0;
  padding-block: 5px;
}

.project-name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.project-description {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.project-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.project-link:hover .project-arrow, .project-link:focus-visible .project-arrow {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.project-preview {
  --frame: #edece8;
  position: relative;
  container-type: size;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border: 1px solid rgb(25 25 23 / 6%);
  border-radius: 14px;
  background: var(--frame);
  box-shadow: 0 8px 22px rgb(28 28 24 / 12%), 0 2px 5px rgb(28 28 24 / 7%);
  transition: box-shadow .25s ease;
}

.project-link:is(:hover, :focus-visible) .project-preview {
  box-shadow: 0 12px 28px rgb(28 28 24 / 17%), 0 3px 7px rgb(28 28 24 / 8%);
}

.capture-site {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fff;
  user-select: none;
}

.project-actions {
  display: flex;
  justify-content: center;
  margin-top: clamp(22px, 3.5vw, 46px);
}

.contact-form { display: grid; gap: 16px; }

.form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}

.contact-form input:not([type="checkbox"]), .contact-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #dedede;
  border-radius: 9px;
  background: #f8f8f8;
  color: var(--ink);
  font: 400 16px/1.4 "Inter", Arial, sans-serif;
  transition: border-color .18s ease, background-color .18s ease;
}

.contact-form textarea { min-height: 110px; resize: vertical; }
.contact-form :is(input, textarea):focus { outline-offset: 2px; background: #fff; }

.contact-form .privacy-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 24px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 400;
  line-height: 1.5;
}

.privacy-check input {
  position: absolute;
  inset: 0 auto auto 0;
  width: 19px;
  height: 19px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.privacy-box {
  pointer-events: none;
  display: grid;
  flex: none;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid #949494;
  border-radius: 5px;
  background: #f8f8f8;
  transition: background-color .18s ease, border-color .18s ease;
}

.privacy-box::after {
  width: 8px;
  height: 5px;
  border: solid white;
  border-width: 0 0 1.5px 1.5px;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(.73);
  transition: opacity .15s ease, transform .18s ease;
}

.privacy-check:hover .privacy-box { border-color: var(--ink); }

.privacy-check input:checked + .privacy-box {
  border-color: var(--ink);
  background: var(--ink);
}

.privacy-check input:checked + .privacy-box::after {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.privacy-check input:focus-visible + .privacy-box {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (forced-colors: active) {
  .privacy-box { forced-color-adjust: none; border-color: CanvasText; background: Canvas; }
  .privacy-check input:checked + .privacy-box { border-color: Highlight; background: Highlight; }
  .privacy-box::after { border-color: HighlightText; }
}

.privacy-check a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px 15px;
}

.form-actions .button { font-weight: 500; }
.form-actions .button:disabled { opacity: .66; cursor: wait; }
.form-status { color: var(--muted); font-size: 13px; line-height: 1.5; }
.form-status:empty { width: 0; }
.form-status[data-state="error"] { color: #9d2727; }
.form-status[data-state="success"] { color: #27613d; }

.site-footer { margin-top: clamp(28px, 3vw, 48px); }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  min-height: 64px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-links { justify-content: flex-end; }
.footer-links a { color: var(--ink); font-size: 13px; }

.contact-dialog {
  width: min(780px, calc(100% - 36px));
  max-height: calc(100% - 36px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgb(28 25 23 / 24%);
  overscroll-behavior: contain;
}

.contact-dialog::backdrop { background: rgb(25 22 20 / 58%); }
body:has(dialog[open]) { overflow: hidden; }

.contact-dialog { width: min(592px, calc(100% - 36px)); }

.contact-dialog[open]::backdrop { animation: backdrop-in .35s ease-out both; }

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.contact-content { position: relative; padding: clamp(21px, 4vw, 36px); }

#contact-title {
  margin-right: 48px;
  font-size: clamp(30px, 4vw, 39px);
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: 1.12;
}

#contact-description {
  margin-block: 9px 21px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.close-details {
  position: absolute;
  right: 18px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.close-details:hover { background: #ebebeb; }

.capture-image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 1.5s cubic-bezier(.22, 1, .36, 1);
}

.project-link:is(:hover, :focus-visible) .capture-image {
  transform: translateY(clamp(var(--capture-pan-limit, -100%), calc(100cqh - 100%), 0px));
}

.project-mark img { display: block; width: 26px; height: 26px; object-fit: contain; }

[data-look="labnet"] { --frame: #e6ecee; }
[data-look="dartsgaleria"] { --frame: #eae6e8; }
[data-look="mslabpro"] { --frame: #e7ebf2; --capture-pan-limit: -16%; }
[data-look="labindex"] { --frame: #e5eeeb; }
[data-look="cleverframe"] { --frame: #ede8e3; }
[data-look="manland"] { --frame: #ebe9e0; }

.project-link [data-look="cleverframe"] .capture-site::after {
  position: absolute;
  inset: 0 0 auto;
  height: 6.4cqw;
  background: url("../assets/portfolio/cleverframe-kepernyokep.webp") top center / 100% auto no-repeat;
  content: "";
  pointer-events: none;
}



@media (max-width: 1020px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .header-inner { min-height: 56px; }
  .contact-links { column-gap: 12px; }
  .contact-links a { font-size: 12px; }
  .contact-icon { width: 16px; height: 16px; }
  .header-contact { min-height: 38px; padding-inline: 15px; font-size: 13px; }
  .intro-inner { padding-block: 25px 26px; }
  .portrait { margin-bottom: 17px; }
  .intro h1 { font-size: clamp(27px, 7.2vw, 40px); }
  .intro p { margin-top: 7px; }
  .projects { padding-top: 26px; }
  .projects > h2 { margin-bottom: 31px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 19px; }
  .project-caption { min-height: 46px; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 0; padding-block: 18px 8px; }
  .footer-links { align-self: flex-end; }
  .close-details { right: 10px; top: 10px; }
}

@media (max-width: 480px) {
  .header-inner { min-height: 70px; gap: 8px; }
  .header-links { flex-direction: column; align-items: flex-start; }
  .header-links a { min-height: 27px; }
  .header-contact { flex-shrink: 0; }
  .form-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-height: 480px) {
  .contact-dialog { max-height: calc(100% - 20px); }
  .contact-content { padding-block: 15px; }
  #contact-title { font-size: 25px; }
  #contact-description { margin-block: 6px 10px; }
  .contact-form { gap: 9px; }
  .contact-form label { gap: 4px; }
  .contact-form input:not([type="checkbox"]) { min-height: 36px; padding-block: 6px; }
  .contact-form textarea { height: 62px; min-height: 62px; padding-block: 6px; }
  .close-details { top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-link:is(:hover, :focus-visible) .capture-image { transform: none; }
  .contact-dialog[open]::backdrop { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
