/* ============================================================
   FONT LOADING — Circular XX / Circular Std (local)
   ============================================================ */
@font-face {
  font-family: 'CircularXX';
  font-weight: 300;
  font-style: normal;
  src: local('CircularXXWeb-Light'), local('CircularXX-Light'),
       local('Circular Std Light'), local('CircularStd-Light'),
       local('Circular-Light');
}
@font-face {
  font-family: 'CircularXX';
  font-weight: 400;
  font-style: normal;
  src: local('CircularXXWeb-Regular'), local('CircularXX-Regular'),
       local('Circular Std'), local('CircularStd'), local('Circular Std Book'),
       local('CircularStd-Book'), local('Circular');
}
@font-face {
  font-family: 'CircularXX';
  font-weight: 500;
  font-style: normal;
  src: local('CircularXXWeb-Medium'), local('CircularXX-Medium'),
       local('Circular Std Medium'), local('CircularStd-Medium'),
       local('Circular-Medium');
}
@font-face {
  font-family: 'CircularXX';
  font-weight: 700;
  font-style: normal;
  src: local('CircularXXWeb-Bold'), local('CircularXX-Bold'),
       local('Circular Std Bold'), local('CircularStd-Bold'),
       local('Circular-Bold');
}

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --white: #ffffff;
  --bg-password: #f5f5f5;
  --text-primary: #333333;
  --text-black: #000000;
  --text-medium: #999999;
  --text-light: #aaaaaa;
  --border: #cccccc;
  --border-light: #eeeeee;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'CircularXX', 'Circular Std', 'CircularStd', -apple-system, BlinkMacSystemFont, sans-serif;
  --container-max: 940px;
  --nav-height: 64px;
  --transition: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--white);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
*, body, html, a, button {
  cursor: none !important;
}

.cursor-wrapper {
  pointer-events: none !important;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  width: 0;
  height: 0;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--text-black);
  border-radius: 50%;
  pointer-events: none !important;
  z-index: 99999;
  translate: -50% -50%;
  transition: background-color var(--transition), opacity var(--transition), transform 0.2s ease;
  will-change: left, top;
  opacity: 0;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.sticky-nav.scrolled {
  border-bottom-color: var(--border-light);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo img {
  width: 110px;
  height: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-black);
  transition: width var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--text-black);
}

/* Mobile hamburger (hidden on desktop) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-black);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav drawer */
.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--white);
  border-top: 1px solid var(--border-light);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.nav-mobile.open {
  max-height: 200px;
}

.nav-mobile .nav-link {
  display: block;
  padding: 16px 20px;
  font-size: 16px;
  border-bottom: 1px solid var(--border-light);
}

.nav-mobile .nav-link::after {
  display: none;
}

/* ============================================================
   PASSWORD GATE
   ============================================================ */
.password-gate {
  position: fixed;
  inset: 0;
  background: var(--bg-password);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 80px 60px;
  transition: opacity 0.5s ease;
}

.password-gate.hidden {
  opacity: 0;
  pointer-events: none;
}

.password-gate-inner {
  max-width: 400px;
  width: 100%;
}

.password-gate-emoji {
  font-size: 32px;
  margin-bottom: 16px;
  line-height: 1;
}

.password-gate-heading {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-black);
  margin-bottom: 28px;
  line-height: 1.3;
}

.password-gate-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.password-gate-input {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 40px;
  width: 100%;
  padding: 0 12px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color var(--transition);
}

.password-gate-input:focus {
  border-color: var(--text-black);
}

.password-gate-input::placeholder {
  color: var(--text-medium);
}

.password-gate-input.error {
  border-color: #ea384c;
  background: #fff5f5;
}

.password-gate-submit {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  background: var(--text-black);
  border: none;
  border-radius: 4px;
  height: 40px;
  padding: 0 20px;
  width: 100%;
  transition: background var(--transition);
}

.password-gate-submit:hover {
  background: #222;
}

.password-gate-hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-medium);
}

.password-gate-hint a {
  text-decoration: underline;
  color: var(--text-primary);
  transition: color var(--transition);
}

.password-gate-hint a:hover {
  color: var(--text-black);
}

.password-error-msg {
  font-size: 12px;
  color: #ea384c;
  margin-top: -6px;
  margin-bottom: 10px;
  display: none;
}

.password-error-msg.visible {
  display: block;
}

/* ============================================================
   FADE-IN ANIMATION UTILITY
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for sequential items */
.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }
.fade-in-delay-5 { transition-delay: 0.5s; }

/* ============================================================
   HOMEPAGE — HERO
   ============================================================ */
.home-hero {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px 20px 60px;
}

.home-heading {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-black);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.home-subheading {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.5;
}

.home-subheading a {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--text-primary);
  transition: color var(--transition);
}

.home-subheading a:hover {
  color: var(--text-black);
}

/* ============================================================
   HOMEPAGE — WORK SECTION
   ============================================================ */
.home-work {
  padding: 20px 0 80px;
}

.home-work-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   PROJECT CARD
   ============================================================ */
.home-case-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 72px;
}

.home-case-card:last-child {
  margin-bottom: 0;
}

.home-case-card-wrapper {
  position: relative;
  margin-bottom: 16px;
}

/* Project image link */
.project-image {
  display: block;
  overflow: hidden;
  border-radius: 2px;
  line-height: 0;
}

.portfolio-cover {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-image:hover .portfolio-cover {
  transform: scale(1.03);
}

/* Logo badge */
.logo-tag-div {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  top: 16px;
  left: 16px;
  z-index: 2;
}

.logo-tag-div.logo-right {
  left: auto;
  right: 16px;
}

.logo-tag-div.award-logo {
  top: 52px;
}

.meta-logo {
  height: 28px;
  width: auto;
}

/* Card info row */
.card-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.home-case-title {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 500;
  color: var(--text-black);
  line-height: 1.3;
  flex: 1;
}

.home-case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  flex-shrink: 0;
}

.home-case-type {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-medium);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
  white-space: nowrap;
  line-height: 1.5;
}

.home-case-subtitle {
  font-family: var(--font-body);
  font-size: clamp(13px, 1.4vw, 15px);
  font-weight: 400;
  color: var(--text-medium);
  line-height: 1.5;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border-light);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-link {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 1px;
}

.social-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-black);
  transition: width var(--transition);
}

.social-link:hover::after {
  width: 100%;
}

.social-link-separator {
  font-size: 14px;
  color: var(--text-light);
}

.footer-copy {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-light);
}

/* ============================================================
   ABOUT — INTRO SECTION
   ============================================================ */
.about-intro {
  padding: 60px 20px 60px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.about-intro-inner {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.about-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.about-text {
  flex: 1;
}

.about-heading1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  color: var(--text-black);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.about-intro-body {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.65;
  margin-bottom: 16px;
}

.about-intro-body:last-child {
  margin-bottom: 0;
}

.about-intro-body strong {
  font-weight: 600;
  color: var(--text-black);
}

/* ============================================================
   ABOUT — DESIGN APPROACH
   ============================================================ */
.about-approach {
  padding: 60px 20px 60px;
  background: var(--white);
}

.about-approach-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.about-approach-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 400;
  color: var(--text-black);
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

/* Flip card grid */
.cards-row {
  display: flex;
  gap: 20px;
}

/* Individual flip card */
.flip-card {
  flex: 1;
  min-height: 320px;
  perspective: 1200px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Front face */
.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.flip-card-front {
  background: #f7f7f5;
}

.flip-card-front.second {
  background: #f0f0ee;
}

.flip-card-front.third {
  background: #ebebea;
}

.card-front-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

/* Back face */
.flip-card-back {
  background: #1a1a1a;
  transform: rotateY(180deg);
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.flip-card-back.second {
  background: #111;
}

.flip-card-back.third {
  background: #0d0d0d;
}

.card-back-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.card-back-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-wrapper-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

.card-wrapper-body {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.65;
}

/* ============================================================
   ABOUT — LEARNING SECTION
   ============================================================ */
.about-learning {
  padding: 60px 20px 80px;
}

.about-learning-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.about-learning-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 400;
  color: var(--text-black);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.about-learning-subtitle {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.65;
  margin-bottom: 12px;
  max-width: 700px;
}

.about-reading-label {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 400;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 28px;
}

.books-row {
  display: flex;
  gap: 24px;
  align-items: flex-end;
}

.book-image-left,
.book-image-center,
.book-image-right {
  flex: 1;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.book-image-left:hover,
.book-image-center:hover,
.book-image-right:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* ============================================================
   RESPONSIVE — TABLET (≤ 991px)
   ============================================================ */
@media (max-width: 991px) {
  :root {
    --container-max: 728px;
  }

  .home-hero {
    padding: 60px 20px 48px;
  }

  .home-heading {
    font-size: 44px;
  }

  .about-intro {
    padding: 48px 20px 48px;
  }

  .cards-row {
    gap: 16px;
  }

  .flip-card {
    min-height: 300px;
  }

  .flip-card-inner {
    min-height: 300px;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE LANDSCAPE (≤ 767px)
   ============================================================ */
@media (max-width: 767px) {
  .home-hero {
    padding: 48px 20px 36px;
  }

  .home-heading {
    font-size: 36px;
  }

  .home-subheading {
    font-size: 15px;
  }

  .card-info-row {
    flex-direction: column;
    gap: 10px;
  }

  .home-case-tags {
    flex-shrink: unset;
  }

  .about-intro-inner {
    gap: 32px;
  }

  .about-img {
    width: 160px;
    height: 160px;
  }

  .cards-row {
    flex-direction: column;
    gap: 16px;
  }

  .flip-card {
    min-height: 240px;
  }

  .flip-card-inner {
    min-height: 240px;
  }

  .books-row {
    gap: 16px;
  }

  /* Logo badge adjustments on mobile */
  .meta-logo {
    height: 22px;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE PORTRAIT (≤ 479px)
   ============================================================ */
@media (max-width: 479px) {
  :root {
    --nav-height: 56px;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-mobile {
    display: flex;
  }

  .home-hero {
    padding: 36px 16px 28px;
  }

  .home-heading {
    font-size: 30px;
    line-height: 1.2;
  }

  .home-subheading {
    font-size: 14px;
  }

  .home-work-container {
    padding: 0 16px;
  }

  .home-case-card {
    margin-bottom: 48px;
  }

  .about-intro {
    padding: 32px 16px 40px;
  }

  .about-intro-inner {
    flex-direction: column;
    gap: 24px;
  }

  .about-img {
    width: 140px;
    height: 140px;
  }

  .about-approach {
    padding: 40px 16px 40px;
  }

  .about-learning {
    padding: 40px 16px 60px;
  }

  .books-row {
    gap: 12px;
  }

  .password-gate {
    padding: 48px 24px;
  }

  .footer {
    padding: 32px 16px;
  }

  /* Hide custom cursor on touch devices */
  .cursor {
    display: none;
  }
}

/* ============================================================
   TOUCH DEVICE — disable cursor element
   ============================================================ */
@media (hover: none) {
  .cursor {
    display: none;
  }

  *, body, html, a, button {
    cursor: auto !important;
  }
}

/* ============================================================
   PROJECT DETAIL PAGE
   ============================================================ */
.project-page {
  background: var(--white);
}

.project-main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 56px 20px 80px;
}

.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.8vw, 54px);
  line-height: 1.12;
  color: var(--text-black);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.project-subtitle {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 32px;
  max-width: 860px;
}

.project-hero-image-wrap {
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 34px;
}

.project-hero-image {
  width: 100%;
  height: auto;
  display: block;
}

.project-body {
  max-width: 760px;
}

.project-body h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  color: var(--text-black);
  margin: 0 0 14px;
}

.project-body p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.72;
  color: var(--text-primary);
  margin: 0 0 18px;
}

.project-back-link {
  display: inline-flex;
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 479px) {
  .project-main {
    padding: 36px 16px 60px;
  }

  .project-body p {
    font-size: 15px;
  }
}
