:root {
  color-scheme: dark;
  font-family: "Inter", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --background: #000;
  --text: #fafaf7;
  --muted: #bdc2c9;
  --muted-soft: #b5bac2;
  --accent: #f0f22b;
}

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

html { min-width: 320px; background: var(--background); }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
}

.portfolio {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}

.dot-field {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  width: 51.6%;
  height: 100%;
  overflow: hidden;
  opacity: .68;
  pointer-events: none;
}

.dot-canvas { display: block; width: 100%; height: 100%; }

.identity {
  position: absolute;
  z-index: 2;
  top: 46px;
  left: 4.17%;
  color: var(--accent);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.03;
}

.portrait {
  position: absolute;
  z-index: 1;
  top: 20%;
  right: 6.74%;
  width: min(35.7vw, 514px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #111;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transition: transform 260ms ease, filter 260ms ease;
}

.portrait:hover img {
  transform: scale(1.025);
  filter: contrast(1.08) brightness(1.035);
}

.portrait::after {
  position: absolute;
  inset: 5%;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 70% 40%, rgba(240, 242, 43, .2), transparent 48%),
    linear-gradient(135deg, rgba(240, 242, 43, .12), transparent 44%);
  content: "";
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(14px);
  transition: opacity 280ms ease;
}

.portrait:hover::after { opacity: .9; }

@media (hover: none) {
  .portrait:hover::after { opacity: 0; }
  .portrait:hover img { transform: none; filter: none; }
}

.intro { display: contents; }

.role {
  position: absolute;
  z-index: 0;
  top: 106px;
  left: 4%;
  width: min(913px, 70vw);
  margin: 0;
  color: var(--accent);
  font-size: clamp(60px, 6.67vw, 96px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -.055em;
  overflow-wrap: normal;
}

.mobile-role-break { display: none; }

h1 {
  position: absolute;
  z-index: 2;
  top: 309px;
  left: 4.17%;
  margin: 0;
  color: var(--text);
  font-size: clamp(48px, 4.72vw, 68px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.045em;
}

h1 span { display: block; }

.ellipsis {
  display: inline-flex;
  gap: .015em;
  margin-left: .015em;
}

h1 .ellipsis-dot {
  display: inline;
  color: var(--text);
  animation: ellipsis-active 1.5s steps(1, end) infinite;
}

h1 .ellipsis-dot:nth-child(2) { animation-delay: -1s; }
h1 .ellipsis-dot:nth-child(3) { animation-delay: -.5s; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes ellipsis-active {
  0%, 32.9% { color: var(--accent); }
  33%, 100% { color: var(--text); }
}

h1 .cooking {
  margin-top: 8px;
  font-size: clamp(64px, 6.25vw, 90px);
  font-weight: 700;
  letter-spacing: -.055em;
}

.ready {
  position: absolute;
  z-index: 2;
  top: 502px;
  left: 4.17%;
  margin: 0;
  color: var(--muted-soft);
  font-size: 29px;
  line-height: 1.03;
}

.description {
  position: absolute;
  z-index: 2;
  top: 589px;
  left: 4.17%;
  width: min(550px, 43vw);
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.03;
}

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

.links {
  position: absolute;
  z-index: 3;
  top: 720px;
  left: 4.17%;
  display: flex;
  align-items: center;
  gap: 30px;
}

.link {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.link-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}

.link-github {
  width: 212px;
  background: var(--accent);
  color: #0a0a0a;
}

.link-linkedin {
  width: 145px;
  border-color: #575e66;
  background: transparent;
  color: #ebedf0;
  font-weight: 600;
}

.link:hover { transform: translateY(-2px); }
.link-github:hover { background: #fbff45; }
.link-linkedin:hover {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}
.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (max-width: 1100px) and (min-width: 761px) {
  .role { width: 70vw; font-size: clamp(58px, 6vw, 76px); }
  .portrait { top: 22%; right: 5%; width: min(38vw, 420px); }
  h1 { top: 300px; font-size: clamp(44px, 5vw, 58px); }
  h1 .cooking { font-size: clamp(58px, 6.2vw, 72px); }
  .ready { top: 470px; font-size: 26px; }
  .description { top: 550px; width: 44vw; font-size: 16px; line-height: 1.15; }
  .links { top: 670px; }
}

@media (min-width: 761px) and (max-height: 820px) {
  .identity { top: 4.5svh; font-size: min(26px, 2.9svh); }
  .role { top: 11svh; font-size: min(6.67vw, 10.3svh, 86px); line-height: 1; }
  .portrait { top: 20svh; width: min(35.7vw, 57svh, 450px); }
  h1 { top: 32svh; font-size: min(4.72vw, 7svh, 60px); }
  h1 .cooking { margin-top: 5px; font-size: min(6.25vw, 10svh, 76px); }
  .ready { top: 55svh; font-size: min(29px, 4.2svh); }
  .description { top: 66svh; font-size: min(18px, 2.5svh); line-height: 1.05; }
  .links { top: 84svh; gap: 24px; }
  .link { min-height: min(52px, 7svh); }
}

@media (max-width: 760px) {
  .portfolio {
    min-height: 100svh;
    overflow: hidden;
  }

  .dot-field {
    right: auto;
    left: 0;
    width: 100%;
    height: 355px;
  }

  .identity {
    top: 42.55svh;
    left: 32px;
    font-size: 26px;
  }

  .portrait {
    top: 2.48svh;
    right: auto;
    left: calc(50% - 3.5px);
    width: min(67.1vw, 31svh, 287px);
    transform: translateX(-50%);
  }

  .portrait:hover img { transform: scale(1.025); }

  .role {
    top: 46.54svh;
    right: clamp(20px, 9.1vw, 39px);
    left: auto;
    width: calc(100% - clamp(20px, 9.1vw, 39px));
    max-width: none;
    font-size: clamp(30px, 9.35vw, 40px);
    line-height: 1.03;
    letter-spacing: -.045em;
    text-align: right;
  }

  .mobile-role-break { display: initial; }

  h1 { display: none; }
  .ready { display: none; }

  .description {
    top: 61.88svh;
    left: 31px;
    width: calc(100% - 62px);
    max-width: 358px;
    font-size: 18px;
    line-height: 1.03;
    text-align: justify;
    text-justify: inter-word;
  }

  .links {
    top: 87.69svh;
    right: auto;
    left: 50%;
    gap: 33px;
    transform: translateX(-50%);
  }

  .link { min-height: 50px; gap: 6px; padding-inline: 8px; font-size: 12px; }
  .link-github { width: 178px; height: 50px; margin-top: 2px; }
  .link-linkedin { width: 145px; min-height: 52px; }
}

@media (max-width: 380px) {
  .identity { left: 24px; font-size: 24px; }
  .role { right: clamp(20px, 9.1vw, 35px); }
  .description { left: 24px; width: calc(100% - 48px); font-size: 17px; }
  .links { gap: 12px; }
  .link-github { width: 165px; }
  .link-linkedin { width: 135px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  h1 .ellipsis-dot { animation: none; }
  h1 .ellipsis-dot:first-child { color: var(--accent); }
}
