/* =========================================================
   Home page only (index.html)
   ========================================================= */

/* ---------- Home sky: gradient, live clouds, grain ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(to bottom, #6aa1e5 0%, #a9ccf4 48%, #dbedfa 100%); }
.sky canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.sky canvas.is-ready { opacity: 1; }
.sky::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .32; mix-blend-mode: soft-light;
}

/* ---------- Hero: a small bento board inside one frosted-glass box ----------
   Left card = columns 1-5 of the box. Title and tiles = columns 6-12.
   No site nav on this page: the tiles are the navigation.               */
.hero--sky { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; }
.hero--sky .wrap { width: 100%; padding-block: var(--margin); }
.hero__main, .hero__grid { display: contents; }

.hero__glass {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 14px;
  width: min(1000px, 100%); margin-inline: auto;
  height: min(600px, calc(100vh - 2 * var(--margin)));
  height: min(600px, calc(100svh - 2 * var(--margin)));
  min-height: 500px;
  padding: 22px;
  border-radius: 36px;
  background: linear-gradient(140deg, rgba(255,255,255,.48), rgba(255,255,255,.22));
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 30px 70px -28px rgba(24,54,96,.45);
}

/* Left card: photo, name, email */
.hero__me {
  grid-column: 1 / span 5; grid-row: 1 / -1; min-height: 0;
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 14px;
  padding: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 22px;
  overflow: hidden;
}
.hero__me-tab {
  position: absolute; top: 16px; left: 16px; z-index: 1;
  height: 36px; padding: 0 16px 0 12px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.92); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.hero__me-tab svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.6; }

.hero__avatar {
  position: relative;
  align-self: center;
  width: min(200px, 62%, 28vh); aspect-ratio: 1; flex: none;
  margin-top: 40px;
  border-radius: 50%;
  background: linear-gradient(160deg, #f8eef3, #ead7e1);
  box-shadow: 0 0 0 5px #fff;
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 12px; color: var(--muted); text-align: center;
}
.hero__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.hero__id { margin-top: auto; }
.hero__im { font-size: 18px; font-weight: 400; line-height: 1.1; opacity: .85; }
.hero__name { font-size: clamp(40px, 4.2vw, 56px); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.hero__mail {
  font-size: 12px; padding-bottom: 6px; max-width: calc(100% - 80px);
  border-bottom: 1px dashed rgba(255,255,255,.7);
  overflow-wrap: anywhere;
  transition: border-color .25s;
}
.hero__mail:hover { border-bottom-style: solid; }

.hero__badge { position: absolute; right: 18px; bottom: 20px; width: 76px; height: 76px; }
.hero__badge text { font: 500 8px var(--font); fill: #fff; }
.hero__badge-text { transform-origin: 50px 50px; animation: spin 22s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Right side */
.hero__title {
  grid-column: 6 / -1; grid-row: 1;
  align-self: center;
  font-size: clamp(48px, min(6.4vw, 11vh), 88px);
  font-weight: 600; letter-spacing: -.05em; line-height: 1;
  padding: 4px 0 2px 2px;
}

.tile {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  padding: 18px;
  border-radius: 20px;
  overflow: hidden;
  min-height: 0;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
/* small corner bracket, like the reference */
.tile::after {
  content: ""; position: absolute; top: 16px; right: 16px; width: 12px; height: 12px;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor; opacity: .55;
  transition: transform .3s var(--ease), opacity .3s;
}
.tile:hover::after { transform: translate(3px, -3px); opacity: 1; }
.tile__label { font-size: 12px; font-weight: 500; letter-spacing: .14em; opacity: .6; margin-bottom: auto; }
.tile__title { font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.tile__sub { font-size: 12px; opacity: .72; }

.tile--about  { grid-column: 6 / span 4; grid-row: 2; background: #f6e4ec; color: var(--ink); }
.tile--cases  { grid-column: 10 / -1; grid-row: 2; background: #f1dfb8; color: var(--ink); }
.tile--graphics {
  grid-column: 6 / -1; grid-row: 3;
  flex-direction: row; align-items: stretch; justify-content: space-between;
  background: #161616; color: #fff;
}
.tile__text { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.tile__stack { position: relative; width: 168px; align-self: center; height: 80px; flex: none; margin-right: 10px; }
.tile__stack i { position: absolute; top: 0; width: 58px; height: 80px; border-radius: 12px; transition: transform .4s var(--ease); }
.tile__stack i:nth-child(1) { right: 90px; background: #f1dfb8; transform: rotate(-8deg); }
.tile__stack i:nth-child(2) { right: 45px;  background: var(--accent); transform: rotate(-1deg); }
.tile__stack i:nth-child(3) { right: 0;     background: #f6e4ec; transform: rotate(7deg); }
.tile--graphics:hover .tile__stack i:nth-child(1) { transform: rotate(-14deg) translateY(-4px); }
.tile--graphics:hover .tile__stack i:nth-child(3) { transform: rotate(13deg) translateY(-4px); }

/* Tablet portrait / phone: stack the board */
@media (max-width: 860px) {
  .hero__glass { height: auto; min-height: 0; grid-template-rows: none; max-width: 640px; }
  .hero__me, .hero__title, .tile--graphics { grid-column: 1 / -1; grid-row: auto; }
  .tile--about, .tile--cases { grid-column: span 6; grid-row: auto; min-height: 150px; }
  .hero__me { padding-top: 72px; min-height: 360px; }
  .hero__avatar { margin-top: 0; width: 180px; }
  .hero__title { text-align: center; font-size: clamp(48px, 13vw, 88px); padding-block: 10px 2px; }
  .tile--graphics { min-height: 132px; }
}
@media (max-width: 620px) {
  .hero--sky .wrap { padding: 16px; }
  .hero__glass { padding: 12px; gap: 10px; border-radius: 28px; }
  .tile { padding: 14px; }
  .tile--about, .tile--cases { min-height: 140px; }
  .tile__stack { width: 112px; margin-right: 4px; }
  .tile__stack i { width: 42px; height: 62px; }
  .tile__stack i:nth-child(1) { right: 60px; }
  .tile__stack i:nth-child(2) { right: 30px; }
}

/* ---------- About page ---------- */
.about .wrap { padding-top: 56px; padding-bottom: 72px; }
.about__board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px var(--gutter);
  align-items: start;
}
.about__photo {
  grid-column: 1 / span 4; grid-row: 1 / span 3; margin: 0; align-self: stretch;
  min-height: 560px;
  position: relative; display: grid; place-items: center;
  border-radius: 44px; overflow: hidden;
  background: linear-gradient(160deg, #f6e4ec, #ece6df);
  font-size: 13px; color: var(--muted);
}
.about__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.about__intro { grid-column: 5 / span 4; grid-row: 1; display: flex; flex-direction: column; gap: 22px; }
.about__hello { font-size: clamp(56px, 8vw, 112px); font-weight: 600; letter-spacing: -.05em; line-height: .95; }
.about__edu   { grid-column: 5 / span 4; grid-row: 2; align-self: end; display: flex; flex-direction: column; gap: 8px; }
.about__skills { grid-column: 9 / span 4; grid-row: 1; display: flex; flex-direction: column; gap: 22px; }
.about__exp   { grid-column: 9 / span 4; grid-row: 2; align-self: end; display: flex; flex-direction: column; gap: 18px; }
.about__contact { grid-column: 5 / span 8; grid-row: 3; align-self: end; padding-top: 24px; border-top: 1px solid var(--line); }

.about__h { font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; letter-spacing: -.01em; text-transform: uppercase; margin-bottom: 4px; }
.about__strong { font-size: 16px; font-weight: 600; letter-spacing: -.005em; line-height: 1.45; }
.about__text { font-size: 16px; line-height: 1.75; }
.about__edu .about__text, .exp .about__text { color: var(--muted); }

.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 14px; }
.skills li { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 11px; line-height: 1.3; color: var(--muted); transition: transform .3s var(--ease); }
.skills li:hover { transform: translateY(-4px); }
.skills img { width: 100%; max-width: 64px; aspect-ratio: 1; border-radius: 16px; box-shadow: var(--shadow); }

.exp { display: flex; flex-direction: column; gap: 20px; }

.about__contact a { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; overflow-wrap: anywhere; }
.about__contact a:hover { text-decoration: underline; text-underline-offset: 4px; }
.about__contact svg { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--ink); fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 02 Case studies (folders) ---------- */
.cases { background: var(--surface); border-block: 1px solid var(--line); }
.cases .wrap { padding-top: 80px; padding-bottom: 88px; display: flex; flex-direction: column; gap: 28px; }
.folders { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px var(--gutter); padding-top: 16px; }
.folder-card { grid-column: span 4; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.folder-card__slot { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.folder { --folder: #efe9df; --folder-line: #d8cfbf; position: relative; display: block; height: 422px; }
.folder > * { position: absolute; }
.folder--rose  { --folder: #f3e6ed; --folder-line: #dcc4d1; }
.folder--stone { --folder: #ebeae7; --folder-line: #d2d0ca; }

.folder__tab {
  left: 0; top: 46px; width: 140px; height: 50px;
  border: 1px solid var(--folder-line);
  border-radius: 12px 12px 0 0;
  background: var(--folder);
}
.folder__back {
  left: 0; right: 0; top: 78px; height: 326px;
  border: 1px solid var(--folder-line);
  border-radius: 16px;
  background: var(--folder);
  box-shadow: var(--shadow);
}
.folder__insert {
  left: 22px; right: 22px; top: 70px; height: 247px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: #fff;
  border: 1px solid var(--folder-line);
  border-radius: 8px;
  box-shadow: 0 6px 18px -8px rgba(22,22,22,.18);
  overflow: hidden;
  transition: transform .5s var(--ease);
}
.folder__image {
  height: 187px; flex: none;
  display: grid; place-items: center;
  background: var(--surface);
  border-radius: 4px;
  font-size: 12px; color: var(--muted);
  overflow: hidden;
}
.folder__image img { width: 100%; height: 100%; object-fit: cover; }
.folder__insert-caption { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.folder__front {
  left: 0; right: 0; top: 225px; height: 179px;
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--folder);
  border: 1px solid var(--folder-line);
  border-radius: 16px;
  box-shadow: 0 -6px 18px -12px rgba(22,22,22,.2);
}
.folder__title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.folder__title { font-size: 20px; font-weight: 500; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder__arrow { flex: none; font-size: 18px; transition: transform .3s var(--ease); }
.folder__cats { display: flex; gap: 6px; flex-wrap: wrap; }
.folder__cats .pill { background: rgba(255,255,255,.7); border-color: var(--folder-line); font-size: 11px; padding: 3px 11px; }

/* The middle folder is open by design; the others slide open on hover / focus. */
.folder--peek .folder__insert { top: 0; transform: rotate(-2.5deg); }
.folder--peek .folder__front  { top: 237px; }
.folder:not(.folder--peek):hover .folder__insert,
.folder:not(.folder--peek):focus-visible .folder__insert { transform: translateY(-70px) rotate(-2.5deg); }
.folder:hover .folder__arrow, .folder:focus-visible .folder__arrow { transform: translate(3px, -3px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .about__cols { grid-template-columns: 1fr; }
  .folder-card { grid-column: 1 / -1; width: 100%; max-width: 440px; justify-self: center; }
}
@media (max-width: 860px) {
  .cases .wrap { padding-block: 52px; }
}
@media (max-width: 420px) {
}

@media (max-width: 1000px) {
  .about__board { gap: 36px var(--gutter); }
  .about__photo, .about__intro, .about__edu, .about__skills, .about__exp, .about__contact { grid-column: 1 / -1; grid-row: auto; }
  .about__photo { min-height: 0; aspect-ratio: 4 / 5; max-width: 440px; }
  .about__edu, .about__exp { align-self: start; }
}
@media (max-width: 860px) {
  .about .wrap { padding-block: 32px 48px; }
  .about__photo { border-radius: 32px; }
}

/* keep the email on one line: the badge sits above it */
.hero--sky .hero__badge { bottom: 54px; }
.hero--sky .hero__mail { max-width: 100%; font-size: clamp(10px, 1.1vw, 12px); }
@media (max-width: 860px) { .hero--sky .hero__mail { font-size: 12px; } }
@media (max-width: 360px) { .hero--sky .hero__mail { font-size: 10px; } }

/* ---------- Brand folders: folder in the brand colour, full logo as the cover ---------- */
.folder--cygnal { --folder: #a51e23; --folder-line: #8a181d; }
.folder--aioni  { --folder: #b51024; --folder-line: #960d1e; }
.folder--revey  { --folder: #821752; --folder-line: #6a1243; }
.folder--brand .folder__front { color: #fff; }
.folder--brand .folder__cats .pill { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); color: #fff; }
.folder--brand .folder__image { background: #fff; align-content: start; padding-top: 14px; }
.folder--brand .folder__image img { width: auto; height: auto; max-width: 78%; max-height: 108px; object-fit: contain; align-self: start; }

/* portrait: keep the face in frame */
.hero__avatar img { object-position: 50% 8%; }
.about__photo img { object-position: 50% 12%; }

/* ---------- Home: cut-out photo that breaks out of the card and the glass box ----------
   Layers: photo (1), colour fade behind the text (2), text and badge (3).          */
.hero--sky .hero__me { overflow: visible; }
.hero__cutout { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero__cutout img {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  height: calc(100% + 56px); width: auto; max-width: none;   /* 56px = how far the head rises above the card */
}
.hero--sky .hero__me::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; z-index: 2;
  border-radius: 0 0 22px 22px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(130,23,82,0), rgba(130,23,82,.86) 45%, var(--accent) 82%);
}
.hero--sky .hero__me-tab { z-index: 3; }
.hero--sky .hero__id, .hero--sky .hero__mail { position: relative; z-index: 3; }
.hero--sky .hero__badge { z-index: 3; }
@media (max-width: 860px) {
  .hero--sky .hero__me { min-height: 500px; margin-top: 18px; }
  .hero__cutout img { height: calc(100% + 40px); }
}

/* ---------- Home: hand-made icons over the tiles ---------- */
.hero__glass { position: relative; }
.tile__icon { position: absolute; pointer-events: none; transition: transform .45s var(--ease); filter: drop-shadow(0 10px 14px rgba(60,10,38,.18)); }
.tile--about .tile__icon, .tile--cases .tile__icon { top: 13%; left: 50%; height: 50%; width: auto; max-width: 76%; object-fit: contain; transform: translateX(-50%) rotate(-4deg); }
.tile--about:hover .tile__icon, .tile--cases:hover .tile__icon { transform: translateX(-50%) translateY(-6px) rotate(3deg); }
.tile--graphics .tile__icon { right: 42px; top: 50%; height: 84%; width: auto; transform: translateY(-50%) rotate(-4deg); filter: none; }
.tile--graphics:hover .tile__icon { transform: translateY(-56%) rotate(4deg); }
.hero__spark { position: absolute; top: -34px; right: -26px; width: 96px; height: auto; z-index: 4; pointer-events: none; filter: drop-shadow(0 10px 14px rgba(24,54,96,.25)); animation: bob 4.5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@media (max-width: 860px) {
  .tile__text { max-width: 62%; }
  .tile--about .tile__icon, .tile--cases .tile__icon { top: 12px; left: auto; right: 34px; height: 44px; transform: rotate(-4deg); }
  .tile--about:hover .tile__icon, .tile--cases:hover .tile__icon { transform: translateY(-4px) rotate(3deg); }
  .tile--graphics .tile__icon { right: 18px; height: 78%; }
  .hero__spark { width: 60px; top: -14px; right: -8px; }
}
@media (prefers-reduced-motion: reduce) { .hero__spark { animation: none; } }
@media (max-width: 620px) {
  .tile--about, .tile--cases { min-height: 180px; }
  .tile--about .tile__icon, .tile--cases .tile__icon { height: 42px; top: 10px; }
}
