/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Krona+One&family=Kufam:ital,wght@0,400;0,500;0,700;1,400&display=swap');

/* === Custom Properties === */
:root {
  --color-bg: #FFFFFF;
  --color-bg-alt: #F2F4F4;
  --color-primary: #143032;
  --color-accent: #3D9198;
  --color-text: #2C3E50;
  --color-contact-bg: #143032;
  --color-footer-bg: #0a1b1c;
  --font-heading: 'Krona One', sans-serif;
  --font-body: 'Kufam', sans-serif;
  --nav-height: 64px;
  --max-width: 1200px;
  --wave-height: 60px;
  --color-btn-overlay: rgba(20, 48, 50, 0.72);
  --color-accent-alpha: rgba(61, 145, 152, 0.3);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; }

/* === Shared layout === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* === Wave divider (positioned inside each section) === */
.section-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 1;
}
.section-wave svg {
  display: block;
  width: 100%;
  height: var(--wave-height);
}


/* === Navigation === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background 0.3s, box-shadow 0.3s;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 12px rgba(20, 48, 50, 0.10);
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #fff;
  font-weight: 700;
  transition: color 0.3s;
}
.nav.scrolled .nav-logo {
  color: var(--color-primary);
}
.nav-links { display: flex; gap: 2.5rem; }
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}
.nav.scrolled .nav-link {
  color: var(--color-text);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--color-accent);
  transition: width 0.25s;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }
.nav-link:hover,
.nav-link.active { color: #fff; }
.nav.scrolled .nav-link:hover,
.nav.scrolled .nav-link.active { color: var(--color-primary); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: #fff;
  transition: transform 0.25s, opacity 0.25s, background 0.3s;
}
.nav.scrolled .nav-hamburger span {
  background: var(--color-primary);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(20, 48, 50, 0.1);
  }
  .nav-links.open { display: flex; }
  .nav-link {
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(20, 48, 50, 0.08);
  }
}

/* Offset anchor scroll for fixed nav */
section[id] {
  scroll-margin-top: var(--nav-height);
}

/* === Hero === */
@keyframes oceanTide {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(10px); }
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #0a1b1c, #143032, #1e5459, #3D9198, #143032, #0a1b1c);
  background-size: 400% 400%;
  animation: oceanTide 14s ease infinite;
  padding: var(--nav-height) 2rem calc(var(--wave-height) + 3rem);
  overflow: hidden;
}
.hero-content { color: #fff; max-width: 720px; }
.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 1.25rem;
}
.hero-name {
  font-family: var(--font-heading);
  white-space: nowrap;
  font-size: clamp(1.5rem, 7.5vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 1rem;
}
.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.375rem);
  font-weight: 300;
  opacity: 0.88;
  letter-spacing: 0.06em;
  margin-bottom: 3.5rem;
}
.hero-arrow {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.65);
  animation: bounce 2.5s ease-in-out infinite;
  transition: color 0.2s;
}
.hero-arrow:hover { color: #fff; }

/* === About === */
.about {
  position: relative;
  background: var(--color-bg);
  padding: 6rem 0 calc(var(--wave-height) + 4rem);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: center;
}
.about-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(20, 48, 50, 0.15);
}
.about-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
}
.about-bio {
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  opacity: 0.9;
}
.btn-primary {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.75rem 2rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 3px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover {
  background: var(--color-accent);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-portrait { max-width: 280px; margin: 0 auto; }
}

@keyframes eduShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* === Education === */
.education {
  position: relative;
  background: var(--color-bg-alt);
  padding: 6rem 0 calc(var(--wave-height) + 4rem);
}

.edu-degree-line {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 0.4rem;
  opacity: 0.85;
  line-height: 1.6;
}

.edu-degree-year {
  font-size: 0.95rem;
  color: var(--color-text);
  opacity: 0.7;
  font-style: italic;
  margin-bottom: 2.5rem;
}

.edu-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.edu-box {
  position: relative;
  background: linear-gradient(135deg, #3d9198 0%, #52adb5 100%);
  color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.4s ease-in-out 0.5s; /* holds for 0.5s before fading */
  cursor: pointer;
}
.edu-box::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: translateX(-100%);
  pointer-events: none;
}
.edu-box:hover::after,
.edu-box:focus-within::after {
  animation: eduShimmer 2.5s ease-in-out forwards;
}

.edu-box:hover,
.edu-box:focus-within {
  transition: box-shadow 0.4s ease-in-out; /* no delay when gaining shadow */
  box-shadow: 0 6px 24px rgba(61, 145, 152, 0.4);
}

.edu-box:focus {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.edu-box__label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.4rem;
}

.edu-box__value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  line-height: 1.3;
}

.edu-box__dropdown {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  /* 0.5s delay before collapsing — prevents glitch when moving quickly between boxes */
  transition: max-height 1s ease-in-out 0.5s, padding-top 1s ease-in-out 0.5s,
              padding-bottom 1s ease-in-out 0.5s, margin-top 1s ease-in-out 0.5s;
  font-size: 0.875rem;
  line-height: 1.6;
  opacity: 0.9;
}

.edu-box:hover .edu-box__dropdown,
.edu-box:focus-within .edu-box__dropdown {
  /* No delay when opening — expands immediately on hover */
  transition: max-height 1s ease-in-out, padding-top 1s ease-in-out,
              padding-bottom 1s ease-in-out, margin-top 1s ease-in-out;
  max-height: 200px;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .edu-boxes { grid-template-columns: 1fr; }
  .education { padding: 4rem 0 calc(var(--wave-height) + 3rem); }
}

/* === Portfolio Sections === */
.portfolio-section {
  position: relative;
  padding: 5rem 0 calc(var(--wave-height) + 3rem);
  overflow: hidden;
}

#social-media   { background: var(--color-bg); }
#graphic-design { background: var(--color-bg-alt); }
.brand-work-section { background: var(--color-bg); }

/* === Coverflow Carousel === */
.carousel-wrapper {
  position: relative;
  height: 360px;
  margin-top: 2.5rem;
  overflow: hidden;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  border-radius: 8px;
  overflow: hidden;
  transform: translate(-50%, -50%);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.5s ease;
  will-change: transform, opacity;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: var(--color-primary);
  color: #fff;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 2.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  user-select: none;
  box-shadow: 0 4px 18px rgba(20, 48, 50, 0.35);
  opacity: 0.55;
}

.carousel-btn:hover {
  background: var(--color-accent);
  box-shadow: 0 6px 24px rgba(20, 48, 50, 0.45);
  opacity: 1;
}
.carousel-btn--prev { left: 1.5rem; }
.carousel-btn--next { right: 1.5rem; }

/* Social Media — 4-per-view sliding track */
#social-media .carousel-wrapper {
  height: auto;
  padding: 0 5.5rem;
  box-sizing: border-box;
}

#social-media .carousel-track {
  position: static;
  display: flex;
  gap: 1rem;
  height: auto;
}

#social-media .carousel-item {
  position: static;
  flex: 0 0 auto;
  width: auto;
  height: 420px;
  transform: none;
  top: auto;
  left: auto;
  transition: opacity 0.4s ease;
}
#social-media .carousel-item img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: fill;
}

/* Graphic Design — same sliding-track layout as Social Media */
#graphic-design .carousel-wrapper {
  height: auto;
  min-height: 480px;
  padding: 0 5.5rem;
  box-sizing: border-box;
}
#graphic-design .carousel-track {
  position: static;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  height: auto;
}
#graphic-design .carousel-item {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  transform: none;
  top: auto;
  left: auto;
  cursor: pointer;
  overflow: visible;
  z-index: 0;
  transition: transform 0.3s ease, opacity 0.4s ease;
}
#graphic-design .carousel-item {
  transition: transform 0.3s ease;
}
#graphic-design .carousel-item:hover { z-index: 2; transform: scale(1.04); }
#graphic-design .carousel-item.active { z-index: 3; transform: scale(1.07); }
#graphic-design .carousel-item img {
  height: 420px;
  width: auto;
  max-width: none;
  object-fit: fill;
  display: block;
  border-radius: 0;
  position: relative;
}
.gd-caption {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  background: #ffffff;
  color: var(--color-text);
  font-size: 0.875rem;
  line-height: 1.65;
  padding: 0 1rem;
  box-sizing: border-box;
  border-radius: 0 0 20px 20px;
}
.gd-caption p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#graphic-design .carousel-item.active .gd-caption {
  max-height: 56px;
  padding: 1rem 1rem 0.75rem;
}

@media (max-width: 768px) {
  #social-media .carousel-wrapper,
  #graphic-design .carousel-wrapper { padding: 0 3.5rem; }
  #social-media .carousel-item,
  #graphic-design .carousel-item { height: 240px; }
}

@media (max-width: 768px) {
  .carousel-wrapper { height: 260px; }
  .carousel-item { width: 200px; height: 200px; }
  .portfolio-section { padding: 4rem 0 calc(var(--wave-height) + 2rem); }
}

/* === Brand Work Panels === */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.brand-panel {
  position: relative;
  background: #eaf2f5;
  border-radius: 20px;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  cursor: pointer;
  transition: box-shadow 0.25s;
  flex-wrap: wrap;
}

.brand-panel:hover {
  box-shadow: 0 8px 28px rgba(20, 48, 50, 0.12);
}

.brand-panel.hidden { display: none; }

.brand-panel__text {
  flex: 1;
  min-width: 0;
}

.brand-panel__text h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.brand-panel__text p {
  color: var(--color-text);
  font-size: 0.875rem;
  line-height: 1.65;
  opacity: 0.85;
}

.brand-panel__thumb {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(20, 48, 50, 0.08);
}

.brand-panel__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-panel__detail {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.6s ease;
}

.brand-grid.has-expanded { grid-template-columns: 1fr; }

.brand-panel.expanded .brand-panel__detail {
  max-height: 500px;
  opacity: 1;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--color-accent);
}


.brand-panel__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.brand-back-btn {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  background: none;
  border: 1.5px solid var(--color-accent);
  border-radius: 20px;
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.brand-back-btn:hover {
  background: var(--color-accent);
  color: #fff;
}

.brand-panel__images img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

@media (max-width: 768px) {
  .brand-grid { grid-template-columns: 1fr; gap: 1rem; }
  .brand-panel.expanded .brand-panel__detail { grid-template-columns: 1fr; }
  .brand-panel { flex-direction: column; text-align: center; }
  .brand-panel__thumb { width: 100px; height: 100px; }
}

/* === Contact === */
.contact {
  background: var(--color-contact-bg);
  padding: 6rem 0;
  text-align: center;
}
.contact-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #fff;
  margin-bottom: 0.75rem;
}
.contact-subtitle {
  color: rgba(255, 255, 255, 0.7);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.contact-email {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 2px;
  margin-bottom: 2.5rem;
  transition: color 0.2s, border-color 0.2s;
}
.contact-email:hover { color: #fff; border-color: #fff; }
.contact-socials {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.social-link:hover {
  color: #fff;
  border-color: var(--color-accent);
  background: rgba(72, 201, 176, 0.15);
}

/* === Footer === */
.footer {
  background: var(--color-footer-bg);
  padding: 1.5rem 0;
  text-align: center;
}
.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.05em;
}

/* === Mobile adjustments === */
@media (max-width: 768px) {
  .about    { padding: 4rem 0 calc(var(--wave-height) + 3rem); }
  .contact  { padding: 4rem 0; }
}
