:root {
  --deep-teal:   #2e4f58;
  --slate-blue:  #4a6a72;
  --terracotta:  #c8845c;
  --warm-gold:   #c8a06a;
  --warm-cream:  #f5ede0;
  --glass-bg:    rgba(245, 237, 224, 0.1);
}

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

html { overflow-x: hidden; }

/* Grid background lives on body so it covers every section */
body {
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  color: var(--deep-teal);
  background-color: var(--warm-cream);
  background-image:
    linear-gradient(rgba(74,106,114,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,106,114,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
  overflow-x: hidden;
}

/* ── Sections ───────────────────────────────────────────── */

/* Base section — content sections shrink to their content */
.section {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 60px 8vw;
  position: relative;
}

/* Section 1: Hero — sits on top of sketch at the overlap */
.section-hero {
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 15vh;
  animation: fadeUp 1s ease-out forwards;
  position: relative;
  z-index: 2;
}

/* warm diagonal brush stroke behind the hero text */
.section-hero::before {
  content: '';
  position: absolute;
  top: 8%;
  left: -8%;
  width: 88%;
  height: 50%;
  background: rgba(224, 168, 152, 0.18);
  border-radius: 50%;
  transform: rotate(-7deg) scaleX(2.2);
  filter: blur(55px);
  pointer-events: none;
  z-index: 0;
}

/* keep hero text above the pseudo-element */
.section-hero > * {
  position: relative;
  z-index: 1;
}

/* Section 2: Sketch — overlaps hero above and content below */
.section-sketch {
  padding: 0;
  height: 55vh;
  min-height: unset;
  position: relative;
  z-index: 1;
  margin-top: 0;
  margin-bottom: -60px;
}

#bgCanvas {
  position: absolute;
  top: 0;
  left: 0;
}

/* Sections 3+: text content — sit on top of sketch at the overlap */
.section-content {
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  z-index: 2;
  padding-top: 30px;
  padding-bottom: 30px;
  /* fade top edge so sketch shows through at the overlap */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%);
}

/* subtle divider between content sections */
.section-content + .section-content {
  border-top: 1px solid rgba(74, 106, 114, 0.1);
}

/* ── Project grid ───────────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.project-card {
  position: relative;
  display: block;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  aspect-ratio: 1 / 1;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-card:hover img {
  transform: scale(1.04);
}

.project-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(46,79,88,0.75), transparent);
  color: var(--warm-cream);
  font-size: 0.85rem;
  font-weight: 500;
  text-shadow: none;
}

@media (max-width: 600px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* Contact icons */
.contact-icon-link {
  display: inline-block;
  color: var(--slate-blue);
  transition: color 0.2s;
  text-decoration: none;
  position: relative;
  top: 6px;
}

.contact-icon-link:hover {
  color: var(--terracotta);
  text-decoration: none;
}

/* ── Animations ─────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ─────────────────────────────────────────── */

h1, h2, h3, p, a, .resume-date {
  text-shadow:
    0px 0px 4px  rgba(245,237,224,1),
    0px 0px 8px  rgba(245,237,224,0.9),
    0px 0px 15px rgba(245,237,224,0.8);
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 5px;
  color: var(--deep-teal);
}

h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 25px;
  color: var(--warm-gold);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(to right, rgba(200,160,106,0.35), transparent) 1;
  padding-bottom: 10px;
}

p { margin-bottom: 15px; font-weight: 300; }

a { color: var(--terracotta); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--deep-teal); text-decoration: underline; }

/* ── Nav ────────────────────────────────────────────────── */

nav {
  margin-top: 15px;
  display: flex;
  gap: 25px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE */
}

nav::-webkit-scrollbar { display: none; } /* Chrome/Safari */

nav a {
  text-decoration: none;
  color: var(--slate-blue);
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0; height: 1px;
  bottom: -3px; left: 0;
  background-color: var(--terracotta);
  transition: width 0.3s ease;
}

nav a:hover { color: var(--terracotta); }
nav a:hover::after { width: 100%; }

/* ── Subtitle / cycling title ───────────────────────────── */

.subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--slate-blue);
  font-size: 1.1rem;
  margin-bottom: 0;
}


/* ── Cards ──────────────────────────────────────────────── */

.card {
  width: 100%;
  background: rgba(245, 237, 224, 0.6);
  border: none;
  border-radius: 8px;
  padding: 40px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow:
    0 2px 12px rgba(46, 79, 88, 0.06),
    0 1px 3px  rgba(46, 79, 88, 0.04);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow:
    0 6px 28px rgba(46, 79, 88, 0.09),
    0 2px 6px  rgba(46, 79, 88, 0.05);
}

/* ── Resume rows ────────────────────────────────────────── */

.resume-item {
  display: flex;
  margin-bottom: 25px;
  gap: 20px;
}

.resume-item:last-child { margin-bottom: 0; }

.resume-date {
  flex: 0 0 150px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--terracotta);
  padding-top: 3px;
  text-align: right;
  white-space: nowrap;
}

.resume-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--deep-teal);
  margin-bottom: 3px;
}

.resume-content p {
  font-size: 0.95rem;
  color: var(--slate-blue);
  margin: 0;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .section { padding: 50px 6vw; }
}

@media (max-width: 600px) {
  .section { padding: 40px 5vw; }
  h1 { font-size: 2.2rem; }
  .card { padding: 30px 20px; }
  .resume-item { flex-direction: column; gap: 2px; }
  .resume-date  { flex: none; font-size: 0.8rem; text-align: left; }
  .resume-content h3 { font-size: 1rem; }
  .resume-content p  { font-size: 0.9rem; }
  nav { gap: 10px 15px; flex-wrap: wrap; }
  nav a { font-size: 0.8rem; letter-spacing: 0.5px; }
}
