/* =====================================================
   Dilan De Zilva — Portfolio
   Design tokens: warm paper background, Fraunces display
   serif, Inter body, JetBrains Mono for labels/data.
   ===================================================== */

:root {
  --paper: #fafaf7;
  --paper-tint: #f2efe8;
  --ink: #16181c;
  --ink-soft: #54585f;
  --ink-faint: #8a8d93;
  --rule: #e2decf;
  --accent: #c2502d;
  --accent-soft: #f3e0d4;
  --sage: #5c6b57;

  --display: "Fraunces", Georgia, serif;
  --display-block: "Unbounded", "Fraunces", Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

  --max: 920px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Eyebrow label (mono, small caps, square bullet) ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.hero-copy .eyebrow {
  justify-content: center;
}
.eyebrow-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

/* ---------- Top navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: block;
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}
.brand-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14.5px;
  font-weight: 500;
}
.topnav a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.topnav a:hover {
  color: var(--ink);
}
.topnav a.active {
  color: var(--ink);
}
.topnav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  background: var(--accent);
}
.nav-cta {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px !important;
  color: var(--ink) !important;
}
.nav-cta:hover {
  background: var(--ink);
  color: var(--paper) !important;
}

@media (max-width: 760px) {
  .topnav {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  position: relative;
  z-index: 2;
}
.hero-copy {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 5.6vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero-lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 54ch;
  margin: 0 0 30px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  justify-content: center;
}
.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-block;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
}
.btn-ghost {
  border-color: var(--rule);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.hero-meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ---------- Floating skill logos ---------- */
.hero-floaters {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.float-logo {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 52px;
  height: 52px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 rgba(22, 24, 28, 0.04);
  animation: float-bob var(--dur, 8s) ease-in-out var(--delay, 0s) infinite;
  opacity: 0.92;
}
.float-logo-icon {
  display: block;
  width: 22px;
  height: 22px;
  opacity: 0.82;
  background-color: var(--ink);
  -webkit-mask-image: var(--icon);
  mask-image: var(--icon);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

@keyframes float-bob {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(6px, -12px) rotate(-4deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-logo {
    animation: none;
  }
}

@media (max-width: 900px) {
  .float-logo {
    width: 44px;
    height: 44px;
  }
  .float-logo-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 760px) {
  .hero {
    padding: 56px 0 48px;
  }
  .float-logo {
    width: 36px;
    height: 36px;
    opacity: 0.8;
  }
  .float-logo-icon {
    width: 15px;
    height: 15px;
  }
}

/* ---------- Section scaffolding ---------- */
.section {
  padding: 76px 0;
  border-top: 1px solid var(--rule);
}
.section-tint {
  background: var(--paper-tint);
}
.section-title {
  font-family: var(--display-block);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 42px);
  margin: 0 0 44px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* ---------- Experience log ---------- */
.log {
  display: flex;
  flex-direction: column;
}
.log-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}
.log-row:first-child {
  border-top: none;
}
.log-when {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-date {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.log-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}
.log-role {
  font-family: var(--display);
  font-weight: 500;
  font-size: 21px;
  margin: 0 0 4px;
}
.log-promo {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--accent);
  vertical-align: middle;
}
.log-org {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 14px;
  font-weight: 500;
}
.log-points {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.log-points li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.log-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  background: var(--rule);
}

@media (max-width: 700px) {
  .log-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ---------- Skills ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 48px;
}
.skill-head {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
  font-weight: 500;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 13px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

@media (max-width: 700px) {
  .skill-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.project-card {
  border: 1px solid var(--rule);
  padding: 26px;
  background: var(--paper);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease;
}
.project-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
}
.project-period {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  margin: 0 0 10px;
  letter-spacing: 0.04em;
}
.project-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 19px;
  margin: 0 0 10px;
}
.project-desc {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.6;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.project-tags li {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--sage);
  background: var(--accent-soft);
  background: #eef1ea;
  padding: 4px 9px;
}
.project-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}
.project-link:hover {
  text-decoration: underline;
}
.project-link--locked {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-faint);
}

.project-card--wide {
  grid-column: 1 / -1;
}

.project-figure {
  margin: 4px 0 18px;
  border: 1px solid var(--rule);
  background: var(--paper-tint);
}
.project-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.project-figure figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  padding: 10px 14px;
  border-top: 1px solid var(--rule);
}

.project-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 14px;
}
.project-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
.project-note {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0 0 16px;
  font-style: italic;
}

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

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

/* ---------- Education ---------- */
.edu-list {
  display: flex;
  flex-direction: column;
}
.edu-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.edu-row:first-child {
  border-top: none;
}
.edu-when {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.edu-note {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin: 6px 0 0;
}

@media (max-width: 700px) {
  .edu-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ---------- Footer / Contact ---------- */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 76px 0 28px;
}
.footer .eyebrow {
  color: #9ca0a8;
}
.footer .eyebrow-dot {
  background: var(--accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid #2c2f35;
}
.footer-title {
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(30px, 4vw, 44px);
  margin: 0 0 16px;
}
.footer-lede {
  font-size: 15.5px;
  color: #b7bac1;
  max-width: 38ch;
}
.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-content: start;
}
.footer-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  border: 1px solid #2c2f35;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.footer-link:hover {
  border-color: var(--accent);
  background: #1c1e23;
}
.footer-link-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8e97;
}
.footer-link-value {
  font-size: 14px;
  font-weight: 500;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: #7e828a;
}
.contact-form{
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hidden-field{ position: absolute; left: -9999px; }
.form-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9CA0A8;
}
.form-field input,
.form-field textarea{
  background: #1C1E23;
  border: 1px solid #2C2F35;
  color: var(--paper);
  padding: 11px 13px;
  font-family: var(--body);
  font-size: 14px;
  border-radius: 2px;
}
.form-field input:focus,
.form-field textarea:focus{
  outline: none;
  border-color: var(--accent);
}
.contact-form .btn-primary{
  align-self: flex-start;
  margin-top: 4px;
  border: none;
  cursor: pointer;
}

@media (max-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-links {
    grid-template-columns: 1fr;
  }
  .footer {
    padding-bottom: 100px;
  } /* clear bottom nav */
}

/* ---------- Mobile bottom navigation ---------- */
.bottomnav {
  display: none;
}

@media (max-width: 760px) {
  .bottomnav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(250, 250, 247, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--rule);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .bottomnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-faint);
    transition: color 0.15s ease;
  }
  .bn-icon {
    width: 21px;
    height: 21px;
  }
  .bottomnav-item.active {
    color: var(--accent);
  }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
