/* ==========================================================
   Sumeeth Ashok Melkera — Portfolio
   Palette: beige #E9E1D3 · charcoal #242321 · black #0D0D0C
            deep brown #35251F · taupe #8A7665 (accent, sparingly)
   ========================================================== */

/* Foda Display is used when installed on the visitor's device or added
   via @font-face (see README.md). Inter is the reliable fallback. */

:root {
  --beige: #E9E1D3;
  --charcoal: #242321;
  --black: #0D0D0C;
  --brown: #35251F;
  --taupe: #8A7665;

  --text: var(--beige);
  --muted: rgba(233, 225, 211, 0.68);
  --line: rgba(233, 225, 211, 0.14);
  --line-strong: rgba(233, 225, 211, 0.28);

  --font-display: "Foda Display", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max: 1240px;
  --gutter: clamp(22px, 6vw, 96px);
  --section: clamp(104px, 14vw, 208px);
  --radius: 10px;
  --radius-frame: 16px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--taupe);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 500 0.95rem/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn--primary { background: var(--beige); color: var(--black); }
.btn--primary:hover { background: #f4eee3; }
.btn--ghost { border-color: var(--line-strong); color: var(--beige); }
.btn--ghost:hover { border-color: var(--taupe); background: rgba(138, 118, 101, 0.14); }
.btn--light { background: var(--beige); color: var(--brown); }
.btn--light:hover { background: #f4eee3; }

/* ---------- Menu toggle (top-left, rounded rectangle) ---------- */
.menu-toggle {
  position: fixed;
  top: clamp(16px, 3vw, 32px);
  left: clamp(16px, 3vw, 40px);
  z-index: 60;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(13, 13, 12, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--beige);
  cursor: pointer;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}
.menu-toggle:hover { border-color: var(--taupe); }
.menu-toggle__bar {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.45s var(--ease);
}
.menu-open .menu-toggle__bar:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.menu-open .menu-toggle__bar:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* ---------- Full-screen menu ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  background: var(--black);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0s linear 0.45s;
}
.menu.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.menu__list {
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vh, 20px);
}
.menu__list a {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7vw, 4.6rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--muted);
  transition: color 0.35s var(--ease), transform 0.35s var(--ease);
}
.menu__list a:hover,
.menu__list a:focus-visible { color: var(--beige); transform: translateX(6px); }
.menu__list li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.menu.is-open .menu__list li { opacity: 1; transform: none; }
.menu.is-open .menu__list li:nth-child(1) { transition-delay: 0.10s; }
.menu.is-open .menu__list li:nth-child(2) { transition-delay: 0.16s; }
.menu.is-open .menu__list li:nth-child(3) { transition-delay: 0.22s; }
.menu.is-open .menu__list li:nth-child(4) { transition-delay: 0.28s; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(96px, 14vh, 140px) var(--gutter);
}
.hero__inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero__mark {
  width: clamp(72px, 9vw, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--charcoal);
  border: 1px solid rgba(138, 118, 101, 0.55);
  margin-bottom: clamp(36px, 6vh, 56px);
}
.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 400;
  text-align: center;
  text-wrap: balance;
}
.hero__first { font-weight: 700; }
.hero__rest { font-weight: 400; }

.hero__tagline {
  margin-top: clamp(20px, 3vh, 32px);
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  letter-spacing: 0.14em;
  /* offset the trailing letter-space so the line is optically centred */
  padding-left: 0.14em;
  color: var(--muted);
  text-align: center;
}
.hero__actions {
  margin-top: clamp(44px, 7vh, 72px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section) 0; }
.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: clamp(48px, 7vw, 96px);
}

/* ---------- Services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.service {
  padding: clamp(30px, 3.2vw, 48px);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.4s var(--ease);
}
.service:hover { border-color: rgba(138, 118, 101, 0.6); }
.service h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.service p { color: var(--muted); max-width: 34ch; }
@media (min-width: 961px) { .service h3 { min-height: 2.5em; } }

/* ---------- Website projects ---------- */
.projects {
  display: flex;
  flex-direction: column;
  gap: clamp(112px, 14vw, 200px);
}
.preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-frame);
  background: var(--charcoal);
  overflow: hidden;
}
.preview__bar {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--taupe);
}
.preview__view {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #171615;
}
.preview__view::before {
  content: attr(data-name);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  color: rgba(233, 225, 211, 0.25);
}
.preview__view iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 900px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.preview__view.is-ready.is-loaded iframe { opacity: 1; }
.preview__link { position: absolute; inset: 0; z-index: 2; border-radius: 0; }
.preview__link:focus-visible { outline-offset: -3px; }

.project__text {
  margin-top: clamp(32px, 4.5vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 6vw, 96px);
  align-items: start;
}
.project__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.project__side { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.project__side p { color: var(--muted); font-size: 1.05rem; max-width: 46ch; text-wrap: balance; }

/* ---------- Graphic design gallery ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: calc(-1 * clamp(16px, 3vw, 40px)) 0 clamp(40px, 6vw, 72px);
}
.filter {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 6px 0;
  font: 500 0.95rem/1.4 var(--font-body);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.filter:hover { color: var(--beige); }
.filter.is-active { color: var(--beige); border-bottom-color: var(--taupe); }

.gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 6vw, 80px);
  transition: opacity 0.25s var(--ease);
}
.gallery.is-switching { opacity: 0; }
.gallery-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 6vw, 80px);
}
.gallery.is-columns {
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(28px, 4vw, 64px);
}

.work { min-width: 0; }
.work__frame {
  padding: 12px;
  background: var(--charcoal);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.6s var(--ease), border-color 0.4s var(--ease);
}
.work__frame img {
  width: 100%;
  height: auto;          /* natural aspect ratio — never cropped */
  display: block;
}
.work:hover .work__frame {
  transform: scale(1.015);
  border-color: rgba(138, 118, 101, 0.55);
}
.work figcaption {
  margin-top: 16px;
  padding-inline: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact {
  margin-top: var(--section);
  padding-block: var(--section);
  background: var(--brown);
}
.contact__lead {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 5rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.contact__sub {
  margin-top: 20px;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: rgba(233, 225, 211, 0.75);
}
.contact__email {
  display: inline-block;
  margin-top: clamp(40px, 6vw, 72px);
  font-size: clamp(1.05rem, 2.4vw, 1.6rem);
  font-weight: 500;
  border-bottom: 1px solid var(--taupe);
  padding-bottom: 4px;
  overflow-wrap: anywhere;
  transition: border-color 0.35s var(--ease);
}
.contact__email:hover { border-color: var(--beige); }
.contact__actions { margin-top: clamp(32px, 4vw, 48px); }
.contact .section__title { margin-bottom: clamp(40px, 6vw, 72px); }

/* ---------- Footer ---------- */
.footer { padding: clamp(56px, 7vw, 88px) 0 clamp(56px, 7vw, 80px); }
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}
.footer__name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }
.footer__tag { margin-top: 8px; font-size: 0.9rem; color: var(--muted); }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 32px; }
.footer__nav a { font-size: 0.92rem; color: var(--muted); transition: color 0.3s var(--ease); }
.footer__nav a:hover { color: var(--beige); }

/* ---------- WhatsApp (floating) ---------- */
.whatsapp {
  position: fixed;
  right: clamp(16px, 2.5vw, 32px);
  bottom: clamp(16px, 2.5vw, 32px);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 18px 0 15px;
  background: rgba(36, 35, 33, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--beige);
  font-size: 0.88rem;
  font-weight: 500;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease), opacity 0.35s var(--ease);
}
.whatsapp:hover { border-color: var(--taupe); background: var(--charcoal); }
.menu-open .whatsapp { opacity: 0; pointer-events: none; }

/* ---------- Reveal (subtle, only when JS is available) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .services { grid-template-columns: 1fr; }
  .service p { max-width: 52ch; }
  .project__text { grid-template-columns: 1fr; }
}

/* ---------- Mobile ---------- */
@media (max-width: 759px) {
  .hero__first, .hero__rest { display: block; }
  .hero__name { font-size: clamp(2.3rem, 11vw, 3.4rem); }
  .hero__tagline { letter-spacing: 0.08em; padding-left: 0.08em; font-size: 0.82rem; }
  .hero__actions { flex-direction: column; align-items: stretch; width: min(100%, 320px); }
  .preview__bar { padding: 12px 16px; font-size: 0.75rem; }
  .footer__inner { flex-direction: column; }
  .footer__nav { justify-content: flex-start; }
  .whatsapp { height: 44px; padding: 0 16px 0 14px; }
}

@media (max-width: 380px) {
  .whatsapp span { display: none; }
  .whatsapp { width: 44px; padding: 0; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
