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

:root {
  --cream: #fffcf9;
  --ink: #1a1814;
  --rose: #954b4d;
  --teal: #36566d;
  --muted: #787878;
  --mono: "Fragment Mono", monospace;
  --sans: "Inter", sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}

/* NAV */
#nav-wrap {
  position: fixed;
  top: 0;
  right: 0;
  width: clamp(115px, 13vw, 170px);
  height: clamp(115px, 13vw, 170px);
  z-index: 200;
  pointer-events: none;
}
#nav-svg {
  position: absolute;
  top: -1px;
  right: -1px;
  width: calc(clamp(115px, 13vw, 170px) + 2px);
  height: calc(clamp(115px, 13vw, 170px) + 2px);
  cursor: pointer;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}
#nav-svg.show {
  opacity: 1;
  pointer-events: auto;
}
#nav-poly {
  fill: var(--rose);
  pointer-events: fill;
  cursor: pointer;
}
#nav-links {
  position: absolute;
  top: clamp(9px, 1.08vw, 14px);
  left: clamp(9px, 1.08vw, 14px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#nav-links.show {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.15s ease 0.1s;
}
#nav-links a {
  display: block;
  font-family: var(--sans);
  font-size: clamp(12px, 1.38vw, 18px);
  margin-bottom: clamp(12px, 1.38vw, 18px);
  font-weight: 400;
  color: var(--cream);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
#nav-links a:first-child {
  margin-top: clamp(7px, 0.77vw, 10px);
}

#nav-links a:last-child {
  margin-bottom: 0;
}

#nav-links a:hover {
  opacity: 0.65;
}

@media (max-width: 480px) {
  #nav-wrap {
    position: absolute;
  }
}

/* HERO */

.hero {
  position: relative;
  min-height: 100vh;
  padding: clamp(60px, 7vw, 99px) clamp(32px, 10vw, 142px)
    clamp(60px, 8.5vw, 120px);
}
.hero-name {
  font-family: var(--mono);
  font-size: clamp(28px, 3.3vw, 48px);
  color: var(--teal);
  font-weight: 400;
  line-height: 1;
  margin-bottom: clamp(4px, 0.6vw, 8px);
  letter-spacing: -0.01em;
  animation-delay: 0.1s;
}
.hero-tagline {
  font-size: clamp(22px, 2.2vw, 32px);
  font-style: italic;
  font-weight: 400;
  color: var(--rose);
  line-height: 1;
  margin-bottom: clamp(18px, 2.8vw, 40px);
  animation-delay: 0.25s;
}
.hero-body {
  max-width: min(622px, 100%);
}
.hero-intro {
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.5;
  margin-bottom: clamp(12px, 1.7vw, 24px);
  animation-delay: 0.4s;
}
.hero-middle {
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.75;
  margin-bottom: clamp(12px, 1.7vw, 24px);
  animation-delay: 0.5s;
}
.hero-path {
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.75;
  margin-bottom: clamp(12px, 1.7vw, 24px);
  animation-delay: 0.6s;
}
.hero-cta {
  font-size: clamp(14px, 1.4vw, 18px);
  font-style: italic;
  margin-bottom: clamp(12px, 1.7vw, 24px);
  animation-delay: 0.7s;
}
.hero-arrow {
  display: block;
  width: clamp(200px, 21vw, 300px);
  height: auto;
  margin-left: clamp(150px, 17vw, 250px);
  animation-delay: 0.85s;
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.8s ease forwards;
}
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CAREER ARC SECTION HEADERS */
.section-header {
  display: flex;
  align-items: center;
  padding: clamp(12px, 2vw, 18px) clamp(16px, 3vw, 24px) 0;
  gap: clamp(10px, 1.5vw, 16px);
}
.section-header-label {
  font-size: clamp(12px, 1.5vw, 16px);
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
}
.section-header-line {
  width: 50px;
  height: 1px;
  background: var(--muted);
  opacity: 0.5;
  transform: scaleX(0);
  transform-origin: left center;
}
.section-header.animated .section-header-line:first-child {
  animation: drawLine 0.3s ease forwards;
}
.section-header.animated .section-header-label {
  animation: fadeLabel 0.2s ease 0.35s forwards;
}
.section-header.animated .section-header-line:last-child {
  animation: drawLine 0.3s ease 0.55s forwards;
}
@keyframes drawLine {
  to {
    transform: scaleX(1);
  }
}
@keyframes fadeLabel {
  to {
    opacity: 1;
  }
}

/* CAREER ARC */
.arc-section {
  position: relative;
  padding: 0 10px 10px;
}
.arc-grid {
  display: grid;
  grid-template-columns: 500px 140px 1fr;
  grid-template-areas:
    "t0 path r0"
    "b0 path r0"
    "t1 path r1"
    "b1 path r1"
    "t2 path r2"
    "b2 path r2"
    "t3 path r3"
    "b3 path r3";
  padding: 0 174px;
  max-width: 1300px;
  margin: 0 auto;
}
.arc-stop-title[data-index="0"] {
  grid-area: t0;
  padding-top: 18px;
}
.arc-stop-title[data-index="1"] {
  grid-area: t1;
}
.arc-stop-title[data-index="2"] {
  grid-area: t2;
}
.arc-stop-title[data-index="3"] {
  grid-area: t3;
}
.arc-stop[data-index="0"] {
  grid-area: b0;
}
.arc-stop[data-index="1"] {
  grid-area: b1;
}
.arc-stop[data-index="2"] {
  grid-area: b2;
}
.arc-stop[data-index="3"] {
  grid-area: b3;
}
.arc-role[data-index="0"] {
  grid-area: r0;
}
.arc-role[data-index="1"] {
  grid-area: r1;
}
.arc-role[data-index="2"] {
  grid-area: r2;
}
.arc-role[data-index="3"] {
  grid-area: r3;
}
.arc-stop-title {
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  padding: 30px 40px 8px 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.arc-stop-title.visible {
  opacity: 1;
  transform: translateY(0);
}
.arc-stop-title.final {
  font-weight: 600;
  color: var(--teal);
}
.arc-stop {
  padding: 6px 40px 30px 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.arc-stop.visible {
  opacity: 1;
  transform: translateY(0);
}
.arc-stop-body {
  font-size: 16px;
  line-height: 1.75;
  color: #3a3834;
  max-width: 416px;
}
.arc-stop-body em {
  font-style: italic;
  font-weight: 700;
  color: var(--rose);
}
.arc-path-col {
  grid-area: path;
  position: relative;
  display: flex;
  justify-content: center;
}
#arc-svg {
  position: sticky;
  top: 0;
  width: 140px;
  height: 100vh;
  overflow: visible;
}
.path-main {
  stroke: var(--rose);
  stroke-width: 1.5;
  stroke-linecap: round;
  fill: none;
  opacity: 0.7;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
}
.path-shadow {
  stroke: var(--rose);
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  opacity: 0.07;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
}
.arc-node {
  fill: var(--rose);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.arc-node.visible {
  opacity: 1;
}
.arc-role {
  padding: 30px 0 30px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease 0.15s, transform 0.65s ease 0.15s;
}
.arc-role.visible {
  opacity: 1;
  transform: translateY(0);
}
.arc-role-title {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.arc-role-sub {
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .section-header {
    padding-left: calc(10px + clamp(20px, 5vw, 48px));
  }
  .arc-section {
    padding-top: clamp(16px, 2vw, 32px);
  }
  .arc-grid {
    display: block;
    padding: 0 clamp(20px, 5vw, 48px);
  }
  .arc-path-col {
    display: none;
  }
  .arc-stop-title {
    padding: 40px 0 0;
    font-size: clamp(18px, 2.5vw, 20px);
  }
  .arc-stop-title:first-child {
    padding-top: 16px;
  }
  .arc-role {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: baseline;
    gap: 0 6px;
    padding: 8px 0 12px;
    min-height: auto;
  }
  .arc-role-title {
    margin-bottom: 0;
    font-size: clamp(12px, 1.8vw, 16px);
  }
  .arc-role-sub {
    font-size: clamp(11px, 1.4vw, 13px);
  }
  .arc-role-sub::before {
    content: "· ";
    color: var(--muted);
  }
  .arc-stop {
    padding: 0;
  }
}

/* KOICHA */
.koicha-section {
  padding: 18px 0 clamp(40px, 7vw, 100px);
}

.koicha-layout {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  margin-top: 0;
  padding-right: clamp(24px, 8vw, 120px);
}

.koicha-card {
  flex-shrink: 0;
  width: clamp(260px, 36vw, 460px);
  background: var(--teal);
  padding: clamp(24px, 3vw, 40px) clamp(24px, 4vw, 52px);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  justify-content: center;
}

.koicha-card-name {
  font-family: var(--mono);
  font-size: clamp(24px, 2.8vw, 36px);
  color: white;
  margin-bottom: clamp(16px, 1.5vw, 20px);
  font-weight: 400;
}

.koicha-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.2s ease;
}
.koicha-link:hover {
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.koicha-card-body {
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.9);
}

.koicha-card-body p {
  margin-bottom: 12px;
}
.koicha-card-body p:last-child {
  margin-bottom: 0;
}

.koicha-viewer {
  flex: 1;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  min-width: 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease 0.15s, transform 0.65s ease 0.15s;
}

.koicha-card.visible,
.koicha-viewer.visible {
  opacity: 1;
  transform: translateY(0);
}

.koicha-screenshots {
  flex: 1;
  display: grid;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  min-width: 0;
}

.koicha-screenshot {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.koicha-screenshot.active {
  opacity: 1;
}

.koicha-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: clamp(20px, 2vw, 28px);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.koicha-btn:hover {
  color: var(--ink);
}

.koicha-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

@media (max-width: 768px) {
  .koicha-layout {
    flex-direction: column;
    align-items: stretch;
    padding-right: 0;
  }
  .koicha-card {
    width: 100%;
  }
  .koicha-viewer {
    padding: 0 clamp(16px, 5vw, 32px);
  }
}

/* FOOTER */
.footer {
  background: var(--rose);
  padding: 28px 24px 12px;
  width: 100%;
}

.footer-hobbies {
  font-size: clamp(12px, 2vw, 16px);
  line-height: 1.65;
  color: var(--cream);
  max-width: 600px;
  margin-bottom: 16px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-credit {
  font-size: clamp(11px, 1.7vw, 14px);
  color: rgba(255, 255, 255, 0.85);
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 16px);
}

.footer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(28px, 3vw, 36px);
  height: clamp(28px, 3vw, 36px);
  color: var(--cream);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.footer-icon:hover {
  opacity: 1;
}
.footer-icon svg {
  width: clamp(18px, 1.8vw, 22px);
  height: clamp(18px, 1.8vw, 22px);
  fill: currentColor;
}
