/*
 * Visual language follows the aws.amazon.com redesign rolled out around re:Invent 2026:
 * warm off-white canvas, near-black ink, 2px outlined controls with 4px corners,
 * underlined blue links, and monospace dates/counters.
 * AWS logos and the proprietary Ember Modern fonts are not bundled; installed copies are used if present.
 */
:root {
  --canvas: #f9f8f6;
  --canvas-raised: #ffffff;
  --topbar: #26231c;
  --ink: #13100b;
  --ink-2: #2f2c25;
  --ink-3: #433f38;
  --ink-muted: #6b665c;
  --line: #d6d1c9;
  --hero-base: #bab6ad;
  --hero-fade: #f8f6f4;
  --link: #005ad2;
  --link-visited: #5b3fc4;
  --focus: #005ad2;
  --pending: #8a5a00;
  --pending-bg: #fff4d6;
  --new: #0a6b2b;
  --new-bg: #ddf6e3;

  --font-display: "Ember Modern Display", "Amazon Ember Display", "Helvetica Neue", Helvetica, Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-text: "Ember Modern Text", "Amazon Ember", "Helvetica Neue", Helvetica, Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-mono: "Ember Modern Mono", "Amazon Ember Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono",
    Menlo, monospace;

  --radius: 4px;
  --gutter: clamp(20px, 6vw, 120px);
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink-2);
  font: 400 16px/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; color: var(--ink); margin: 0; }

.mono { font-family: var(--font-mono); }

/* Korean breaks lines between words, not inside them. */
:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }

.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: 8px; top: -48px; padding: 8px 16px; z-index: 10;
  background: var(--ink); color: #fff; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

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

/* ---------- Top bar ---------- */
.topbar { background: var(--topbar); color: #f4f1ec; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: 16px; }
.topbar__label { font-size: 14px; letter-spacing: 0.01em; }

.lang-toggle { display: inline-flex; flex: none; border: 2px solid #f4f1ec; border-radius: var(--radius); overflow: hidden; }
.lang-toggle button {
  font: 500 13px/1 var(--font-text); padding: 7px 14px; border: 0; cursor: pointer; white-space: nowrap;
  background: transparent; color: #f4f1ec;
}
.lang-toggle button[aria-pressed="true"] { background: #f4f1ec; color: var(--ink); }
.lang-toggle button:not([aria-pressed="true"]):hover { background: rgba(244, 241, 236, 0.14); }

/* ---------- Hero ---------- */
.hero {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(100% 140% at 60% -10%, rgba(248, 246, 244, 0) 0%, var(--hero-fade) 75%),
    var(--hero-base);
  padding: 56px 0 64px;
}
.eyebrow { margin: 0 0 8px; font: 500 14px/1.5 var(--font-mono); color: var(--ink-3); letter-spacing: 0.04em; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.15; }
.lead { margin: 16px 0 0; max-width: 46em; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.period { margin: 20px 0 0; font-size: 14px; color: var(--ink-3); }

/* ---------- Tabs ---------- */
.tabs { border-bottom: 1px solid var(--line); background: var(--canvas); position: sticky; top: 0; z-index: 5; }
.tabs__inner { display: flex; gap: 32px; }
.tab {
  display: inline-block; padding: 14px 0 12px; border-bottom: 3px solid transparent; margin-bottom: -1px;
  font: 500 16px/1.4 var(--font-display); color: var(--ink-3); text-decoration: none;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Report teaser (list view) ---------- */
.teaser {
  margin: 32px 0 0; padding: 20px 24px; background: var(--canvas-raised);
  border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--radius);
}
.teaser[hidden] { display: none; }
.teaser__label { margin: 0 0 6px; font-size: 12px; color: var(--ink-3); }
.teaser__headline { margin: 0 0 10px; font: 500 18px/1.5 var(--font-display); color: var(--ink); }
.teaser__link { font: 500 14px/1.4 var(--font-text); color: var(--link); text-underline-offset: 4px; }
.teaser__link::after { content: " →"; }

/* ---------- Report view ---------- */
.report-view { padding: 48px 0 80px; }
.report-view > h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; }
.report-view__note { margin: 8px 0 20px; max-width: 52em; font-size: 14px; color: var(--ink-3); }
#report { outline: none; }

.report { margin-top: 32px; max-width: 980px; }
.report__head { padding-bottom: 28px; border-bottom: 2px solid var(--ink); }
.report__meta { margin: 0 0 12px; font-size: 13px; color: var(--ink-3); }
.report__headline { font-size: clamp(22px, 2.8vw, 30px); line-height: 1.4; }
.report__overview { margin: 16px 0 0; font-size: 17px; line-height: 1.8; color: var(--ink-2); }

.report__section { padding: 32px 0 8px; }
.report__section-title { margin: 0 0 8px; font: 500 22px/1.3 var(--font-display); color: var(--ink); }

.highlights { list-style: none; margin: 0; padding: 0; }
.highlight { display: grid; grid-template-columns: 56px 1fr; gap: 0 16px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.highlight__num { font-size: 28px; line-height: 1.1; color: var(--ink-3); }
.highlight__title { margin: 0 0 10px; font: 500 19px/1.45 var(--font-display); color: var(--ink); }
.highlight__text { margin: 0 0 12px; font-size: 16px; line-height: 1.8; }

.refs { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.6; }
.refs li { padding: 3px 0 3px 16px; position: relative; }
.refs li::before { content: ""; position: absolute; left: 2px; top: 0.85em; width: 6px; height: 1px; background: var(--ink-3); }
.refs .link { overflow-wrap: anywhere; }
.refs__time { font-size: 12px; color: var(--ink-muted); }

.trends { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 0 40px; }
.trend { padding: 20px 0; border-bottom: 1px solid var(--line); }
.trend__title { margin: 0 0 8px; font: 500 17px/1.45 var(--font-display); color: var(--ink); }
.trend__text { margin: 0 0 10px; font-size: 15px; line-height: 1.75; }
.trend__refs summary { cursor: pointer; font: 500 13px/1.6 var(--font-text); color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.trend__refs .refs { margin-top: 8px; }

.breakdown { display: grid; gap: 16px; padding-top: 8px; }
.breakdown__row { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; align-items: start; }
.breakdown__title { margin: 4px 0 0; font: 500 14px/1.4 var(--font-text); color: var(--ink-3); }
.breakdown .tags { margin: 0; }
.tag__count { font-size: 11px; opacity: 0.7; }
.report__all { margin: 28px 0 0; }
.button {
  display: inline-block; padding: 10px 24px; border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: #fff; font: 500 15px/1.4 var(--font-text); text-decoration: none;
}
.button:hover { background: #2f2c25; }
.report__foot { margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-muted); }

/* ---------- Filters ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.filters { padding: 48px 0 8px; }
.filters h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; margin-bottom: 20px; }

.search {
  display: flex; align-items: center; gap: 12px; max-width: 880px;
  border-bottom: 1px solid var(--line); padding: 4px 0 8px; margin-bottom: 28px;
}
.search:focus-within { border-bottom-color: var(--ink); }
.search__icon { width: 22px; height: 22px; flex: none; color: var(--ink); }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 6px 4px;
  font: 400 17px/1.5 var(--font-text); color: var(--ink);
}
.search input::placeholder { color: var(--ink-muted); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search__hint {
  flex: none; padding: 1px 7px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 12px; color: var(--ink-muted);
}
.search:focus-within .search__hint { display: none; }

.facet { margin: 0 0 20px; }
.facet__title { margin: 0 0 10px; font: 500 15px/1.4 var(--font-display); color: var(--ink); }
.facet__note { margin: -4px 0 12px; font-size: 13px; color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 12px; cursor: pointer; text-align: left;
  font: 500 14px/1.35 var(--font-text); color: var(--ink);
  background: var(--canvas-raised); border: 2px solid var(--ink); border-radius: var(--radius);
}
.chip:hover { background: #efece6; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chip__count { font: 400 12px/1.3 var(--font-mono); color: inherit; opacity: 0.75; }
.chip[disabled] { border-color: var(--line); color: var(--ink-muted); background: transparent; cursor: default; }
.chip--date { flex-direction: column; align-items: flex-start; gap: 2px; min-width: 112px; padding: 8px 16px; font-size: 15px; }
.chips__more {
  padding: 5px 4px; border: 0; background: none; cursor: pointer;
  font: 500 14px/1.35 var(--font-text); color: var(--ink); text-decoration: underline; text-underline-offset: 4px;
}
.chips__empty { font-size: 13px; color: var(--ink-muted); }

/* ---------- Results header ---------- */
.results-head { margin-top: 24px; scroll-margin-top: 16px; }
.active-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 16px; margin-bottom: 4px;
  background: #efece6; border-radius: var(--radius);
}
.active-filters[hidden] { display: none; }
.active-filters__label { font: 500 13px/1.4 var(--font-text); color: var(--ink-3); margin-right: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 12px; cursor: pointer;
  font: 500 13px/1.5 var(--font-text); color: #fff; background: var(--ink); border: 0; border-radius: 999px;
}
.pill::after { content: "×"; font-size: 15px; line-height: 1; opacity: 0.8; }
.pill:hover::after { opacity: 1; }
.active-filters__clear {
  margin-left: auto; padding: 2px 0; border: 0; background: none; cursor: pointer;
  font: 500 13px/1.5 var(--font-text); color: var(--ink); text-decoration: underline; text-underline-offset: 4px;
}

/* ---------- Status line ---------- */
.status {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin: 8px 0 0; padding: 8px 0 12px; border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}

/* ---------- List ---------- */
.list { padding: 8px 0 80px; outline: none; }

.day { padding-top: 40px; }
.day__heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.day__heading h2 { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.25; }
.day__range { font: 400 13px/1.4 var(--font-mono); color: var(--ink-3); }
.day__count { margin-left: auto; font: 400 13px/1.4 var(--font-mono); color: var(--ink-3); }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 0 56px; }

.item { padding: 28px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.item.is-new { animation: arrive 2.4s ease-out; }
@keyframes arrive { from { background: var(--new-bg); } to { background: transparent; } }

.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 10px; font-size: 12px; color: var(--ink-2); }
.icon { width: 16px; height: 16px; flex: none; }
.item__jst { color: var(--ink-muted); }

.badge { padding: 1px 8px; border-radius: 999px; font: 500 11px/1.6 var(--font-text); }
.badge--pending { background: var(--pending-bg); color: var(--pending); }
.badge--failed { background: #fde7e7; color: #a4161a; }
.badge--new { background: var(--new-bg); color: var(--new); }

.item__title { font-size: 19px; line-height: 1.4; margin-bottom: 12px; overflow-wrap: anywhere; }

.link {
  color: var(--link); text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%; background-repeat: no-repeat; background-size: 100% 1px;
  padding-bottom: 2px; transition: background-size 0.15s;
}
.link:hover { background-size: 100% 2px; }
.link:visited { color: var(--link-visited); }

.item__body { margin: 0; font-size: 15px; line-height: 1.75; color: var(--ink-2); overflow-wrap: anywhere; }
.item__body.is-placeholder { color: var(--ink-muted); }

.item__source { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 10px 0 0; font-size: 13px; }
.item__ai { font: 400 12px/1.4 var(--font-mono); color: var(--ink-muted); }
.item__ai[hidden] { display: none; }
.item__original { color: var(--link); text-underline-offset: 3px; }
.item__original::after { content: " ↗"; }

.tags { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags[hidden] { display: none; }
.tag {
  display: inline-block; padding: 2px 9px; border-radius: var(--radius); text-decoration: none;
  font: 500 12px/1.6 var(--font-text); color: var(--ink-2); border: 1px solid transparent;
}
.tag:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag--category { border-color: var(--ink-3); color: var(--ink); }
.tag--service { background: #e8edf7; color: #0b3d91; }
.tag--keyword { background: #efece6; color: var(--ink-2); }
.tag--keyword::before { content: "#"; margin-right: 1px; opacity: 0.6; }
.tag--source { background: #ff9900; color: var(--ink); font-family: var(--font-text); }
.item__meta .tag--source { padding: 0 8px; font-size: 11px; }
.item__src[hidden] { display: none; }
.tag.is-active { outline: 2px solid var(--ink); outline-offset: 1px; }

.empty { padding: 56px 0; font-size: 16px; color: var(--ink-3); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: #f1efeb; }
.footer__inner { padding-top: 32px; padding-bottom: 36px; font-size: 13px; color: var(--ink-3); }
.footer p { margin: 0 0 6px; }
.footer a { color: var(--link); }

.author { max-width: 880px; padding-bottom: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.author__heading { margin: 0 0 8px; font-size: 12px; font-weight: 400; letter-spacing: 0.04em; color: var(--ink-3); }
.footer .author__name { margin: 0 0 10px; font: 500 17px/1.5 var(--font-display); color: var(--ink); }
.author__via { margin-left: 6px; font-size: 11px; color: var(--ink-muted); }
.footer .author__bio { margin: 0 0 8px; font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.disclaimer { max-width: 880px; padding-bottom: 20px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.disclaimer__heading { margin: 0 0 8px; font-size: 12px; font-weight: 400; letter-spacing: 0.04em; color: var(--ink-3); }
.disclaimer__list { margin: 0; padding-left: 1.2em; font-size: 12px; line-height: 1.75; color: var(--ink-3); }
.disclaimer__list li { margin: 0 0 4px; }
.author__body { display: grid; grid-template-columns: 72px 1fr; gap: 18px; align-items: start; }
.author__photo { display: block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--canvas); }

@media (max-width: 640px) {
  .author__body { grid-template-columns: 56px 1fr; gap: 14px; }
  .author__photo { width: 56px; height: 56px; }
  .tabs__inner { gap: 20px; }
  .highlight { grid-template-columns: 1fr; }
  .highlight__num { font-size: 20px; margin-bottom: 6px; }
  .breakdown__row { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 44px; }
  .chip--date { min-width: 0; flex: 1 1 calc(50% - 8px); }
  .active-filters__clear { margin-left: 0; }
  .day__count { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .item.is-new { animation: none; }
  .link { transition: none; }
}
